/[cvs]/nfo/projects/netfraggle/bin/FraggleCtlModules.py
ViewVC logotype

Contents of /nfo/projects/netfraggle/bin/FraggleCtlModules.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Wed Sep 1 22:29:47 2004 UTC (19 years, 10 months ago) by xabbu
Branch: MAIN
Changes since 1.1: +14 -2 lines
File MIME type: text/x-python
+FraggleCtlModules in function ScanModules modules are now being scaned from the toplvl dir 'modules' and imported if existent

1 import os
2 import string
3
4 import fraggleParserXML
5 from fraggleEngine import *
6
7
8 def create(parent):
9 return FraggleCtlModules(parent)
10
11 class FraggleCtlModules:
12
13 def __init__(self,parent):
14 self.ScanModules()
15 self.engine = parent
16 pass
17
18 def ScanModules(self):
19 os.chdir('..')
20 self.dir = os.listdir(os.path.join(os.getcwd(),'modules'))
21 for i in self.dir:
22 self.dir[self.dir.index(i)] = string.rstrip(i,'.py')
23
24
25 if len(self.dir) != 0:
26 try:
27 for i in self.dir:
28 self.modules = {i:__import__(i)}
29 print self.modules
30 print self.dir
31 except ImportError:
32 pass
33
34
35

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed