2 def findsenf(sysdirs = ('/usr/local/lib/senf','/usr/lib/senf'),
3 subdirs = ('', 'senf', 'Senf', 'SENF')):
7 p = d.split(os.path.sep)
8 return (os.path.join(p[0]+os.path.sep,*p[1:i]) for i in range(len(p),0,-1))
10 for d in itertools.chain(ancestors(os.getcwd()),sysdirs):
12 py = os.path.join(d,s,'site_scons/senfutil.py')
13 if os.path.exists(py) and not os.path.samefile(py,__file__): return py
15 raise ImportError, 'senfutil not found'
17 # replace module with real senfutil
20 sys.path.append(os.path.dirname(__file__))
22 execfile(__file__, locals(), globals())