fabric-tasksetExpose class members as Fabric tasks | |
Download |
fabric-taskset Ranking & Summary
Advertisement
- License:
- MIT/X Consortium Lic...
- Price:
- FREE
- Publisher Name:
- Mikhail Korobov
- Publisher web site:
- http://bitbucket.org/kmike/
fabric-taskset Tags
fabric-taskset Description
Fabric has class-based tasks but they are limited: Task class represents a single task.fabric-taskset is a Python module to make it possible to have class-based Fabric task sets.Installationpip install fabric-tasksetUsageTaskSet is a class that can expose its methods as Fabric tasks.Example:# my_lib/say.pyfrom taskset import TaskSet, taskclass SayBase(TaskSet): def say(self, what): raise NotImplemented() @task(default=True, alias='hi') def hello(self): self.say('hello')class EchoSay(SayBase): def say(self, what): local('echo ' + what)instance = EchoSay()instance.expose_to_current_module()# fabfile.pyfrom mylib import sayand then e.g.:$ fab say.hihellotaskset.task is a decorator declaring the wrapped method to be task. It acceps the same arguments as fabric.decorators.task so use it on methods just like fabric's decorator is used on functions.Acknowledgementshttps://github.com/ramusus/fabriclassed is a very similar app. At the time of writing it is focused on old-style Fabric tasks and has a small deployment framework included.In order to feed my NIH syndrome I create Fabric-taskset which exposes new-style Fabric tasks, provides slightly different API and doesn't have extra goodies.Product's homepage
fabric-taskset Related Software