Discussion:
[Fab-user] Problem with imports
Geir Engebakken
2013-10-22 11:02:08 UTC
Permalink
Sorry if this is an obvious error, but I am trying to do the following and get into trouble :

fabfile.py :

import *from util
import a


a.py :

import * from util

util.py defines a fab function func() :

@task
@roles('test')
def func():




Now when I do a fab -list I get the following :

func
a.func


Is this due to fabric, or am I using import statements wrongly?






Geir
Jeff Forcier
2013-10-22 15:56:04 UTC
Permalink
Hi Geir,

Please see the fabfile/task declaration docs here:
http://docs.fabfile.org/en/1.8/usage/tasks.html - this is something
Fabric is doing. You may want to rearrange things so you're only
importing actual @task-decorated functions one time.

-Jeff

On Tue, Oct 22, 2013 at 4:02 AM, Geir Engebakken
Post by Geir Engebakken
Sorry if this is an obvious error, but I am trying to do the following and
import *from util
import a
import * from util
@task
@roles(‘test')
func
a.func
Is this due to fabric, or am I using import statements wrongly?
Geir
_______________________________________________
Fab-user mailing list
https://lists.nongnu.org/mailman/listinfo/fab-user
--
Jeff Forcier
Unix sysadmin; Python/Ruby engineer
http://bitprophet.org
Loading...