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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations)
Sun Sep 5 00:21:10 2004 UTC (20 years, 2 months ago) by xabbu
Branch: MAIN
Changes since 1.3: +1 -1 lines
File MIME type: text/x-python
+Fixed File Menu Modules item on Posix system. Gotta do testing on Windows with it.

1 xabbu 1.1 import os
2 xabbu 1.2 import string
3 xabbu 1.1
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 xabbu 1.3 self.modules = self.ScanModules()
15 xabbu 1.1 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 xabbu 1.2 for i in self.dir:
22 xabbu 1.3 self.dir[self.dir.index(i)] = string.rstrip(i,'.py')
23    
24 xabbu 1.2
25    
26     if len(self.dir) != 0:
27     try:
28     for i in self.dir:
29 xabbu 1.3 try:
30     fmodules[i] = i
31     except NameError:
32     fmodules = {i:i}
33     print fmodules
34 xabbu 1.2 print self.dir
35 xabbu 1.3
36 xabbu 1.4 #del fmodules['CVS']
37 xabbu 1.3 return fmodules
38 xabbu 1.2 except ImportError:
39     pass
40    
41 xabbu 1.3 return None
42    
43 xabbu 1.1
44    

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