Mixins¶
The Task
class inherits from many mixins, which provide a lot of useful
utilities for performing common server admin tasks.
AptMixin¶
DockerMixin¶
FileMixin¶
-
class
refit.mixins.file.
FileMixin
[source]¶ -
-
async
create_folder
(path, owner='root', group='root', permissions='755')[source]¶ Creates folder, and all intermediate directories.
Only changes the group and owner of the deepest directory. If each folder in the chain needs certain permissions, call this function repeatedly for each folder.
- Return type
None
-
async
PathMixin¶
PythonMixin¶
SystemdMixin¶
TemplateMixin¶
Custom Mixins¶
There’s nothing magical about the builtin mixins - you can develop your own, and inherit from them.
from refit.task import Task
class MyMixin():
def hello_world(self):
print('hello world')
class MyTask(Task, MyMixin):
async def run(self):
self.hello_world()