Changeset 1295
- Timestamp:
- 08/09/07 01:54:48 (6 years ago)
- Location:
- branch/ggpolo
- Files:
-
- 2 added
- 6 modified
-
higwidgets/higlabels.py (modified) (3 diffs)
-
share/umit/config/umit.conf (modified) (1 diff)
-
umitCore/DataDecay.py (added)
-
umitDB/Remove.py (modified) (4 diffs)
-
umitDB/XMLStore.py (modified) (1 diff)
-
umitGUI/MainWindow.py (modified) (2 diffs)
-
umitInventory/ConfigureDataRemoval.py (added)
-
umitInventory/Viewer.py (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branch/ggpolo/higwidgets/higlabels.py
r1179 r1295 26 26 """ 27 27 28 __all__ = ['HIGSectionLabel', 'HIGHintSectionLabel', 'HIGEntryLabel', 'HIGDialogLabel'] 28 __all__ = ['HIGSectionLabel', 'HIGHintSectionLabel', 'HIGEntryLabel', 29 'HIGDialogLabel'] 29 30 30 31 import gtk … … 44 45 class HIGHintSectionLabel(gtk.HBox, object): 45 46 """ 46 Bold label used to define sections, with a little icon that shows up a hint when mouse is47 over it.47 Bold label used to define sections, with a little icon that shows up a 48 hint when mouse is over it. 48 49 """ 49 50 def __init__(self, text=None, hint=None): … … 62 63 63 64 self.hint_image = gtk.Image() 64 self.hint_image.set_from_stock(gtk.STOCK_DIALOG_INFO, gtk.ICON_SIZE_SMALL_TOOLBAR) 65 self.hint_image.set_from_stock(gtk.STOCK_DIALOG_INFO, 66 gtk.ICON_SIZE_SMALL_TOOLBAR) 65 67 66 68 self.add(self.hint_image) -
branch/ggpolo/share/umit/config/umit.conf
r1258 r1295 95 95 search_db = 1 96 96 97 [database] 98 umit_decay = 60 99 inventory_decay = 0 -
branch/ggpolo/umitDB/Remove.py
r1292 r1295 19 19 20 20 from datetime import datetime, timedelta 21 22 from umitCore.Logging import log 21 23 22 24 from umitDB.Connection import ConnectDB … … 88 90 to_remove = scans_ids.difference(inventory_scans_ids) 89 91 92 if not to_remove: 93 # nothing to do 94 return 95 96 log.debug(">>> Removing UMIT scans older than %d days \ 97 from database.." % older_than) 98 90 99 # remove scans 91 100 for scan_id in to_remove: 92 101 self.remove_scan(scan_id) 102 103 log.debug(">>> Removal completed") 93 104 94 105 … … 110 121 (old_data_date, )).fetchall() 111 122 scans_ids = [id[0] for id in scans_ids] 123 124 if not scans_ids: 125 # nothing to do 126 return 127 128 log.debug(">>> Removing Inventory scans older than %d days \ 129 from database.." % older_than) 112 130 113 131 # remove scans … … 125 143 126 144 self.conn.commit() 145 146 log.debug(">>> Removal completed") 127 147 128 148 -
branch/ggpolo/umitDB/XMLStore.py
r1178 r1295 19 19 20 20 from datetime import datetime 21 21 22 from umitCore.NmapParser import NmapParser 23 22 24 from umitDB.Connection import ConnectDB 23 25 from umitDB.Store import RawStore -
branch/ggpolo/umitGUI/MainWindow.py
r1268 r1295 55 55 from umitCore.UmitDB import Scans, UmitDB 56 56 from umitCore.Utils import amiroot, is_maemo 57 from umitCore.DataDecay import remove_old_data 57 58 import umitCore.Scheduler as Scheduler 58 59 … … 1018 1019 UmitDB().cleanup(SearchConfig().converted_save_time) 1019 1020 1020 # Stop Scheduler if it is running 1021 #if os.path.isfile(os.path.split(Path.config_file)[0] + \ 1022 #"/schedrunning"): 1023 # subprocess.Popen([sys.executable, Path.sched_control, 'stop']) 1021 # Remove old data from database 1022 remove_old_data() 1024 1023 1025 1024 gtk.main_quit() -
branch/ggpolo/umitInventory/Viewer.py
r1261 r1295 34 34 from umitCore.I18N import _ 35 35 from umitCore.Paths import Path 36 from umitCore.DataDecay import remove_old_data 36 37 37 38 from umitDB.Retrieve import InventoryRetrieve … … 46 47 from umitInventory.InventoryTree import InventoryTree 47 48 from umitInventory.Timeline import TLHolder 49 from umitInventory.ConfigureDataRemoval import ConfigureDataRemoval 48 50 49 51 umitdb = Path.umitdb_ng … … 375 377 # hosts info 376 378 hb = gtk.HBox() 377 hb.pack_start(gtk.Label(_("Hosts: %s" % ', '.join(host for host in hosts))), False, False, 0) 379 hb.pack_start(gtk.Label(_("Hosts: %s" % ', '.join(host for host in hosts))), 380 False, False, 0) 378 381 box.pack_start(hb, False, False, 0) 379 382 … … 419 422 for invid, invname in self.invdb.get_inventories_ids_names(): 420 423 root = tr.append(None, ['%s' % invname]) 421 tr.append(root, [inventory_info])422 424 423 425 # retrieve scans id for each inventory 424 for scan in self.invdb.get_scans_id_for_inventory(invid): 426 scans_ids = self.invdb.get_scans_id_for_inventory(invid) 427 if scans_ids: 428 tr.append(root, [inventory_info]) 429 430 for scan in scans_ids: 425 431 426 432 # retrieve scan finish timestamp … … 436 442 # check if host is already in current Inventory 437 443 new_host = False 438 #if self.addresses.has_key(invname):444 439 445 if invname in self.addresses: 440 446 if not addr in self.addresses[invname]: 441 newlist = self.addresses[invname] # this is the old 442 # list actually 443 newlist.append(addr) # now this is the new list 444 self.addresses[invname] = newlist 447 self.addresses[invname].append(addr) 445 448 new_host = True 446 449 else: … … 663 666 None, self.schedctrl.status_text, 664 667 self.schedctrl._scheduler_control), 668 669 # Edit 670 ('Control Data Removal', None, _("Data Removal"), None, 671 _("Data Removal"), self._edit_data_removal) 665 672 ] 666 673 … … 711 718 </menu> 712 719 <menuitem action='ShowTips' /> 720 <menuitem action='Control Data Removal' /> 713 721 </menu> 714 722 </menubar> … … 733 741 734 742 743 def _edit_data_removal(self, event): 744 """ 745 Open window for editing data removal for Inventories. 746 """ 747 w = ConfigureDataRemoval() 748 w.show_all() 749 750 735 751 def _edit_inventory(self, event): 736 752 """ … … 763 779 self.daddy.running_ni = False 764 780 else: # started umit with -i argument 781 # Remove old data from database 782 remove_old_data() 783 765 784 gtk.main_quit() 766 785
