Changeset 827 for branch/max/umitGUI/ScriptManager.py
- Timestamp:
- 06/17/07 15:55:13 (6 years ago)
- Files:
-
- 1 modified
-
branch/max/umitGUI/ScriptManager.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branch/max/umitGUI/ScriptManager.py
r735 r827 22 22 from gtksourceview import SourceView, SourceLanguagesManager, SourceBuffer 23 23 24 #from umitCore.Paths import Search 25 Search = None 24 from umitCore.Paths import check_access 26 25 from umitCore.I18N import _ 27 26 … … 49 48 # aux nmap_fetchfile functions 50 49 # XXX: will be moved into Paths.Search or/and into Python/Nmap wrapper 50 def get_file_list(path): 51 return [f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))] 52 51 53 class NmapFetch(object): 52 54 def __init__(self): … … 59 61 for path in self.fetchdirs(): 60 62 fullpath = os.path.join(path, filename) 61 if Search.check_access(fullpath, os.R_OK):63 if check_access(fullpath, os.R_OK): 62 64 return fullpath 63 65 return None … … 67 69 for path in self.fetchdirs(): 68 70 try: 69 for filename in Search.get_file_list(path):71 for filename in get_file_list(path): 70 72 fullpath = os.path.join(path, filename) 71 if Search.check_access(fullpath, os.R_OK):73 if check_access(fullpath, os.R_OK): 72 74 result.append(fullpath) 73 75 except OSError: … … 189 191 def add_dir(self, dirname): 190 192 res = False 191 for name in Search.get_file_list(dirname):193 for name in get_file_list(dirname): 192 194 if name.endswith('.nse'): 193 195 try: … … 205 207 206 208 # Singletone 207 #script_manager = ScriptManager()209 script_manager = ScriptManager() 208 210 209 211 # GUI classes … … 313 315 314 316 def add_file(self, filename): 315 if Search.check_access(filename, os.R_OK):317 if check_access(filename, os.R_OK): 316 318 try: 317 319 script_manager.add_file(filename)
