On Mon, May 11, 2009 at 3:29 PM, Jeff Forcier <[email protected]> wrote: > Hi Aljosa, > > Unforunately, Fabric 0.1 and older do not support splitting a fabfile > into multiple files, so I'm afraid you're out of luck for the time > being.
Actually, it does. See the help-text for the "load" operation. You would use this function instead of python imports in old-fabric. > > Fabric 0.9 is on the way and should support this sort of thing; there > is currently an alpha out (http://fabfile.org), and while I do not > suggest using an alpha or beta for production work, you may want to > try it out in a test environment to get an idea of how the final > product might behave. > > 0.9's main focus is on allowing code to be plain Python with less > magic, so while I haven't yet tried this approach out, it should be > possible for you to perform imports like in your below example, and > have it "just work". > > Best, > Jeff > > On Mon, May 11, 2009 at 9:17 AM, Aljosa Mohorovic > <[email protected]> wrote: >> i'm trying to split a large fabfile.py but i can't find any examples >> in docs and there is no info how should i use "config" when "fabric >> actions" are defined in a different file. >> my code looks similar to: >> -------------------------------------------------------------------------- >> config.project = 'some project' >> config.[...] # other options >> >> from deploy.something import some_fab_action >> >> def local(): >> "set development env: LOCAL" >> config.fab_user = 'aljosa' >> config.fab_hosts = ['localhost',] >> config.project_root = os.path.abspath('.') >> >> [...] >> -------------------------------------------------------------------------- >> >> now when i call "$ fab local some_fab_action" how should i use >> "config" in some_fab_action which is in "deploy.something" and >> imported into fabfile.py? >> any tips/ideas are welcome. >> >> Aljosa Mohorovic >> >> >> _______________________________________________ >> Fab-user mailing list >> [email protected] >> http://lists.nongnu.org/mailman/listinfo/fab-user >> > > > _______________________________________________ > Fab-user mailing list > [email protected] > http://lists.nongnu.org/mailman/listinfo/fab-user > -- Venlig hilsen / Kind regards, Christian Vest Hansen. _______________________________________________ Fab-user mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/fab-user
