11 |
class FraggleCtlModules: |
class FraggleCtlModules: |
12 |
|
|
13 |
def __init__(self,parent): |
def __init__(self,parent): |
14 |
self.ScanModules() |
self.modules = self.ScanModules() |
15 |
self.engine = parent |
self.engine = parent |
16 |
pass |
pass |
17 |
|
|
19 |
os.chdir('..') |
os.chdir('..') |
20 |
self.dir = os.listdir(os.path.join(os.getcwd(),'modules')) |
self.dir = os.listdir(os.path.join(os.getcwd(),'modules')) |
21 |
for i in self.dir: |
for i in self.dir: |
22 |
self.dir[self.dir.index(i)] = string.rstrip(i,'.py') |
self.dir[self.dir.index(i)] = string.rstrip(i,'.py') |
23 |
|
|
24 |
|
|
25 |
|
|
26 |
if len(self.dir) != 0: |
if len(self.dir) != 0: |
27 |
try: |
try: |
28 |
for i in self.dir: |
for i in self.dir: |
29 |
self.modules = {i:__import__(i)} |
try: |
30 |
print self.modules |
fmodules[i] = i |
31 |
|
except NameError: |
32 |
|
fmodules = {i:i} |
33 |
|
print fmodules |
34 |
print self.dir |
print self.dir |
35 |
|
|
36 |
|
del fmodules['CVS'] |
37 |
|
return fmodules |
38 |
except ImportError: |
except ImportError: |
39 |
pass |
pass |
40 |
|
|
41 |
|
return None |
42 |
|
|
43 |
|
|
44 |
|
|