Changeset 3821
- Timestamp:
- 12/15/08 12:29:21 (4 years ago)
- Location:
- branch/NetworkInventory
- Files:
-
- 17 modified
-
. (modified) (1 prop)
-
install_scripts/macosx/setup.py (modified) (2 diffs)
-
install_scripts/unix/MANIFEST.in (modified) (1 diff)
-
install_scripts/unix/setup.py (modified) (4 diffs)
-
install_scripts/utils/add_splash_version.py (modified) (1 diff)
-
install_scripts/windows/setup.py (modified) (2 diffs)
-
share/pixmaps/splash.png (modified) (previous)
-
share/umit/config/umit_version (modified) (1 diff)
-
umitCore/Diff.py (modified) (1 diff)
-
umitCore/NmapParser.py (modified) (2 diffs)
-
umitCore/Paths.py (modified) (2 diffs)
-
umitCore/SearchResult.py (modified) (1 diff)
-
umitGUI/MainWindow.py (modified) (2 diffs)
-
umitGUI/ScanHostDetailsPage.py (modified) (1 diff)
-
umitGUI/ScanNotebook.py (modified) (2 diffs)
-
umitGUI/SearchGUI.py (modified) (5 diffs)
-
umitGUI/SearchWindow.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branch/NetworkInventory
- Property svnmerge-integrated
-
old new 1 /trunk:1-560 1 /trunk:1-560,1370-1397,1399-1418,1420-1464
-
- Property svnmerge-integrated
-
branch/NetworkInventory/install_scripts/macosx/setup.py
r1318 r3821 27 27 28 28 VERSION = "0.9.4" 29 REVISION = "1 288"29 REVISION = "1453" 30 30 31 31 # Directories for POSIX operating systems … … 59 59 [os.path.join(config_dir, 'scan_profile.usp')] + 60 60 [os.path.join(config_dir, 'umit_version')] + 61 [os.path.join(config_dir, 'umit.db')] +62 61 glob(os.path.join(config_dir, '*.xml'))+ 63 62 glob(os.path.join(config_dir, '*.txt'))), -
branch/NetworkInventory/install_scripts/unix/MANIFEST.in
r1349 r3821 10 10 recursive-include share/umit/docs/wizard *.xml 11 11 recursive-include share/umit/docs/screenshots *.png 12 recursive-include share/umit/config *.xml *.conf *.usp *.txt *.dbumit_version12 recursive-include share/umit/config *.xml *.conf *.usp *.txt umit_version 13 13 recursive-include share/umit/misc *.dmp 14 14 recursive-include umitCore *.py -
branch/NetworkInventory/install_scripts/unix/setup.py
r1349 r3821 26 26 27 27 from glob import glob 28 from stat import ST_MODE 28 from stat import ST_MODE, S_IRWXU, S_IRGRP, S_IROTH 29 29 30 30 31 31 VERSION = "0.9.4" 32 REVISION = "1 288"32 REVISION = "1463" 33 33 34 34 # Directories for POSIX operating systems … … 118 118 install.run(self) 119 119 120 self.set_perms() 121 self.set_modules_path() 120 122 self.fix_paths() 121 123 self.create_uninstaller() … … 156 158 mode = ((os.stat(uninstaller_filename)[ST_MODE]) | 0555) & 07777 157 159 os.chmod(uninstaller_filename, mode) 160 161 def set_modules_path(self): 162 umit = os.path.join(self.install_scripts, "umit") 163 modules = self.install_lib 164 165 re_sys = re.compile("^import sys$") 166 167 ufile = open(umit, "r") 168 ucontent = ufile.readlines() 169 ufile.close() 170 171 uline = None 172 for line in xrange(len(ucontent)): 173 if re_sys.match(ucontent[line]): 174 uline = line + 1 175 break 176 177 ucontent.insert(uline, "sys.path.append('%s')\n" % modules) 178 179 ufile = open(umit, "w") 180 ufile.writelines(ucontent) 181 ufile.close() 182 183 print ">>> UMIT", open(umit, "r").readlines()[:uline + 5] 184 185 def set_perms(self): 186 re_bin = re.compile("(bin)") 187 for output in self.get_outputs(): 188 if re_bin.findall(output): 189 continue 190 191 if os.path.isdir(output): 192 os.chmod(output, S_IRWXU | \ 193 S_IRGRP | \ 194 S_IXGRP | \ 195 S_IROTH | \ 196 S_IXOTH) 197 else: 198 os.chmod(output, S_IRUSR | 199 S_IWUSR | \ 200 S_IRGRP | \ 201 S_IROTH) 158 202 159 203 def fix_paths(self): … … 241 285 version = VERSION, 242 286 scripts = ['umit', 'scheduler-umit'], 243 packages = ['', 'umitCore', 'umitDB', 'umitGUI', 'umitInventory', 287 packages = ['', 'umitCore', 'umitDB', 'umitGUI', 'umitInventory', 244 288 'higwidgets'], 245 289 data_files = data_files, -
branch/NetworkInventory/install_scripts/utils/add_splash_version.py
r1318 r3821 30 30 FONT = os.path.join(BASE_DIR, "fonts", "FreeSansBold.ttf") 31 31 VERSION = "0.9.4" 32 REVISION = "1 288"32 REVISION = "1453" 33 33 34 34 splash = Image.open(os.path.join(BASE_DIR, "images", "splash.png")) -
branch/NetworkInventory/install_scripts/windows/setup.py
r1318 r3821 31 31 32 32 VERSION = "0.9.4" 33 REVISION = "1 288"33 REVISION = "1453" 34 34 35 35 # Directories for POSIX operating systems … … 73 73 [os.path.join(config_dir, 'scan_profile.usp')] + 74 74 [os.path.join(config_dir, 'umit_version')] + 75 [os.path.join(config_dir, 'umit.db')] +76 75 glob(os.path.join(config_dir, '*.xml'))+ 77 76 glob(os.path.join(config_dir, '*.txt'))), -
branch/NetworkInventory/share/umit/config/umit_version
r1318 r3821 1 1 0.9.4 2 1 2882 1453 -
branch/NetworkInventory/umitCore/Diff.py
r1179 r3821 31 31 32 32 self.umit_top_banner = ['|'+'-'*70+'|\n', 33 '|'+_('UMIT - The nmap frontend').center (70)+'|\n',34 '|'+_('http://umit.sourceforge.net').center(70)+'|\n',35 '|'+' '*70+'|\n',36 '|'+_('This diff was generated by UMIT').center(70)+'|\n',37 '|'+_("(Changes to this file can make UMIT unable to read it.)").center(70)+'|\n',38 '|'+'-'*70+'|\n',39 '\n',40 '-'*10+_(' Start of diff ')+'-'*10+'\n']33 '|'+_('UMIT - The nmap frontend').center (70)+'|\n', 34 '|'+_('http://umit.sourceforge.net').center(70)+'|\n', 35 '|'+' '*70+'|\n', 36 '|'+_('This diff was generated by UMIT').center(70)+'|\n', 37 '|'+_("(Changes to this file can make UMIT unable to read it.)").center(70)+'|\n', 38 '|'+'-'*70+'|\n', 39 '\n', 40 '-'*10+_(' Start of diff ')+'-'*10+'\n'] 41 41 42 42 self.end_diff = ['\n'+'-'*10+_(' End of diff ')+'-'*10+'\n'] -
branch/NetworkInventory/umitCore/NmapParser.py
r1318 r3821 751 751 752 752 self.nmap_xml_file = None 753 self.unsaved = False 753 754 754 755 def set_parser(self, parser): … … 1271 1272 return xml_file 1272 1273 1274 def set_unsaved(self): 1275 self.unsaved = True 1276 1277 def is_unsaved(self): 1278 return self.unsaved 1273 1279 1274 1280 def nmap_parser_sax(nmap_xml_file=""): -
branch/NetworkInventory/umitCore/Paths.py
r1349 r3821 30 30 31 31 VERSION = "0.9.4" 32 REVISION = "1 288"32 REVISION = "1453" 33 33 34 34 CONFIG_DIR = join("share", "umit", "config") … … 295 295 copy_config_file("target_list.txt", main_dir, user_dir) 296 296 copy_config_file("umit_version", main_dir, user_dir) 297 copy_config_file("umit.db", main_dir, user_dir)298 297 copy_config_file("umitng.db", main_dir, user_dir) 299 298 copy_config_file("timeline-settings.conf", main_dir, user_dir) -
branch/NetworkInventory/umitCore/SearchResult.py
r1318 r3821 295 295 yield parsed 296 296 297 class SearchTabs(SearchResult, object): 298 def __init__(self, notebook): 299 self.scan_notebook = notebook 300 301 def get_scan_results(self): 302 scan_file = None 303 for i in range(self.scan_notebook.get_n_pages()): 304 sbook_page = self.scan_notebook.get_nth_page(i) 305 306 if not sbook_page.status.get_empty(): 307 scan_file = sbook_page.command_execution.get_xml_output_file() 308 if scan_file and os.access(scan_file, os.R_OK) and os.path.isfile(scan_file): 309 log.debug(">>> Retrieving unsaved scan result: %s" % scan_file) 310 311 try: 312 parsed = NmapParser() 313 parsed.set_xml_file(scan_file) 314 parsed.parse() 315 parsed.set_scan_name("Unsaved " + sbook_page.get_tab_label()) 316 parsed.set_unsaved() 317 except: 318 pass 319 else: 320 yield parsed 297 321 298 322 if __name__ == "__main__": -
branch/NetworkInventory/umitGUI/MainWindow.py
r1331 r3821 469 469 470 470 def _search_scan_result(self, widget): 471 search_window = SearchWindow(self._load_search_result )471 search_window = SearchWindow(self._load_search_result, self.scan_notebook) 472 472 search_window.show_all() 473 473 474 474 def _load_search_result(self, results): 475 475 for result in results: 476 page = self._load(parsed_result=results[result][1], 476 if results[result][1].is_unsaved(): 477 for i in range(self.scan_notebook.get_n_pages()): 478 if results[result][0] == "Unsaved " + \ 479 self.scan_notebook.get_nth_page(i).get_tab_label(): 480 self.scan_notebook.set_current_page(i) 481 else: 482 page = self._load(parsed_result=results[result][1], 477 483 title=results[result][1].scan_name) 478 page.status.set_search_loaded()484 page.status.set_search_loaded() 479 485 480 486 def _close_scan_cb(self, widget, data=None): … … 867 873 if (response == gtk.RESPONSE_OK): 868 874 filename = self._save_results_filechooser_dialog.get_filename() 869 filter = self._save_results_filechooser_dialog.get_filter() 870 # determine file extension from filter and filename 871 if (filter.get_name() == "UMIT Scan Results (*.usr)" and 872 not (filename.find('.usr') == len(filename)-4)): 873 filename += '.usr' 875 # add .usr to filename if there is no other extension 876 if filename.find('.') == -1: 877 filename += ".usr" 874 878 self._save(current_page, filename) 875 879 -
branch/NetworkInventory/umitGUI/ScanHostDetailsPage.py
r1179 r3821 265 265 try: 266 266 self.set_osclass(os['osclass']) 267 self.osclass_expander.set_use_markup(True) 267 268 table.attach(self.osclass_expander,0,2,y1,y2) 268 269 except:pass -
branch/NetworkInventory/umitGUI/ScanNotebook.py
r1331 r3821 461 461 self.set_tab_label(profile) 462 462 463 ####464 # Setting status to scanning465 self.status.set_scanning()466 ####467 468 463 if target != '': 469 464 self.toolbar.add_new_target(target) 470 465 466 if (command.find("-iR") == -1 and command.find("-iL") == -1): 467 if command.find("<target>") > 0: 468 warn_dialog = HIGAlertDialog(message_format=_("No Target Host!"), 469 secondary_text=_("Target specification \ 470 is mandatory. Either by an address in the target input box or through the '-iR' and \ 471 '-iL' nmap options. Aborting scan."), 472 type=gtk.MESSAGE_ERROR) 473 warn_dialog.run() 474 warn_dialog.destroy() 475 return 476 471 477 if command != '': 478 # Setting status to scanning 479 self.status.set_scanning() 472 480 self.execute_command(command) 473 481 else: … … 480 488 warn_dialog.run() 481 489 warn_dialog.destroy() 482 490 483 491 def close_tab(self): 484 492 try: -
branch/NetworkInventory/umitGUI/SearchGUI.py
r1318 r3821 37 37 from umitCore.UmitLogging import log 38 38 from umitCore.NmapParser import months 39 from umitCore.SearchResult import SearchDir, SearchDB 39 from umitCore.SearchResult import SearchDir, SearchDB, SearchTabs 40 40 from umitCore.UmitConf import SearchConfig 41 41 … … 50 50 51 51 class SearchGUI(gtk.HPaned, object): 52 def __init__(self ):52 def __init__(self, notebook): 53 53 gtk.HPaned.__init__(self) 54 54 … … 89 89 self.scan_num = 1 90 90 self.id = 0 91 self.notebook = notebook 91 92 92 93 def _create_widgets(self): … … 424 425 self.append_result(result) 425 426 426 427 427 if self.directory: 428 428 search_dir = SearchDir(self.directory, self.file_extension) … … 430 430 for result in search_dir.search(**search_dict): 431 431 self.append_result(result) 432 433 search_tabs = SearchTabs(self.notebook) 434 for result in search_tabs.search(**search_dict): 435 self.append_result(result) 432 436 433 437 def clear_result_list(self): -
branch/NetworkInventory/umitGUI/SearchWindow.py
r1215 r3821 52 52 53 53 class SearchWindow(BaseSearchWindow, object): 54 def __init__(self, load_method ):54 def __init__(self, load_method, notebook): 55 55 BaseSearchWindow.__init__(self) 56 56 57 57 self.load_method = load_method 58 self.notebook = notebook 58 59 59 60 self._create_widgets() … … 66 67 self.btn_open = HIGButton(stock=gtk.STOCK_OPEN) 67 68 self.btn_close = HIGButton(stock=gtk.STOCK_CLOSE) 68 self.search_gui = SearchGUI( )69 self.search_gui = SearchGUI(self.notebook) 69 70 70 71 def _pack_widgets(self):
