fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] Dynamically Create Task?


From: Chris Spencer
Subject: [Fab-user] Dynamically Create Task?
Date: Thu, 22 Oct 2015 11:19:26 -0400

Is it possible to dynamically define a Fabric task?

Currently, in order to make `fab` show the task mymodule.mytask, I need to define the function `mytask` inside `mymodule`. As I use Fabric more, I'm finding this gets very tedious, because different modules often define similar functions, so I end up writing duplicate code. I'm trying to refactor my code to be more object-oriented, and would like to register class methods as tasks, but I can't find a reliable way to do this.

How can I tell Fabric to expose an arbitrary callable with a specific name, regardless of which package or module it resides in?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]