|
From: | Travis Swicegood |
Subject: | [Fab-user] Getting some changes into the mainline of Fabric |
Date: | Mon, 26 Jul 2010 11:26:09 -0500 |
Howdy all; Earlier this year I added a few features to Fabric that I've always wanted to see. In talking with Jeff about them, we're getting close to having them added in. As such, I'm posting the changes here in hopes that we can make them the best they could possibly be. First, one of my main goals was to maintain BC. All of the features added continue to work as they always have, with a few additions. Things add: * @task decorator: if one of these is present, only Task objects are used * __all__ support: secondarily, if there is an __all__ within the fabfile, it is used to determine what is a task and what is not * namespaced task modules: any module that's imported into a fabfile that has a module-level variable of FABRIC_TASK_MODULE = True is added, with it's name (i.e., import db would mean the task is referenced via db.init, import db as awesome is awesome.init) * Added a write_to_file() and write() to fabric.contrib.files to allow differing ways of writing to files * Added fabric.operations.do() which allows you to switch between local/run by setting env.run_as (useful for using the same Fabric tasks locally to do the same things it can do remotely) * Added `via` kwarg to all operations to allow overriding the internal command that is being run You can view all of these on GitHub via the compare view: If you have any comments, suggestions, etc., please let me know. FWIW, I've been using this branch of Fabric since December and it's worked great. If you want to see some examples of the new syntax for namespaced tasks, checkout the d51.fabric.tasks.* repos at http://github.com/domain51/ -T |
[Prev in Thread] | Current Thread | [Next in Thread] |