Changeset 949
- Timestamp:
- 07/05/07 19:10:49 (6 years ago)
- Location:
- branch/ggpolo
- Files:
-
- 6 modified
-
umitDB/connection.py (modified) (2 diffs)
-
umitDB/retrieve.py (modified) (2 diffs)
-
umitDB/search.py (modified) (1 diff)
-
umitInventory/changeslist.py (modified) (1 diff)
-
umitInventory/invtree.py (modified) (1 diff)
-
umitInventory/viewer.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branch/ggpolo/umitDB/connection.py
r926 r949 25 25 from umitDB._database import database 26 26 from umitDB.utils import debug 27 28 def dict_factory(cursor, row): 29 """ 30 Convert a standard row to a dict. 31 """ 32 d = {} 33 34 for idx, col in enumerate(cursor.description): 35 d[col[0]] = row[idx] 36 37 return d 38 27 39 28 40 class ConnectDB: … … 55 67 56 68 69 def use_dict_cursor(self): 70 """ 71 Change to dict_factory cursor. 72 """ 73 self.cursor.close() 74 self.conn.row_factory = dict_factory 75 self.cursor = self.conn.cursor() 76 77 78 def use_standard_cursor(self): 79 """ 80 Change to standard cursor. 81 """ 82 self.cursor.close() 83 self.conn.row_factory = None 84 self.cursor = self.conn.cursor() 85 86 57 87 def get_id_for(self, table_name): 58 88 """ -
branch/ggpolo/umitDB/retrieve.py
r927 r949 422 422 debug("Getting port data for pdata..") 423 423 424 fullpdata = self.cursor.execute("SELECT protocol.name , \424 fullpdata = self.cursor.execute("SELECT protocol.name as protocol, \ 425 425 port_state.state, service_info.product, \ 426 426 service_info.version, service_info.extrainfo, \ … … 430 430 port_state.pk = ? AND service_info.pk = ? AND \ 431 431 service_name.pk = service_info.fk_service_name", 432 (protocol_id, port_state_id, service_info_id)).fetchall()[0] 432 (protocol_id, port_state_id, 433 service_info_id)).fetchall()[0] 433 434 434 435 return fullpdata -
branch/ggpolo/umitDB/search.py
r937 r949 149 149 # search for port with number in looking_for 150 150 if compare: 151 #self.conn.create_function("compare", 3, perform_comparison)152 #search = self.cursor.execute("SELECT port.portid FROM port \153 # JOIN _host_port ON (_host_port.fk_port=port.pk) \154 # WHERE _host_port.fk_host=? AND \155 # compare(port.portid, ?, ?)", (host_id,156 # compare,157 # looking_for)).fetchall()158 151 search = self.cursor.execute("SELECT port.portid FROM port \ 159 152 JOIN _host_port ON (_host_port.fk_port=port.pk) \ -
branch/ggpolo/umitInventory/changeslist.py
r935 r949 291 291 if item[0] == host_scans[d][0]: 292 292 d += 1 293 else: 294 down_order.append(item[0]) 295 down_d[item[0]] = item[1] 293 296 294 297 return (down_d, down_order) -
branch/ggpolo/umitInventory/invtree.py
r940 r949 37 37 class InventoryTree(gtk.HBox): 38 38 """ 39 A hbox that holds a gtk.TreeView that holds all inventories in database. 39 A HBox that holds a Notebook that holds a ScrolledWindow that holds a 40 TreeView that holds all inventories in database. 40 41 """ 41 42 -
branch/ggpolo/umitInventory/viewer.py
r940 r949 61 61 umitdb = Path.umitdb_ng 62 62 63 NI_VER = '0.2' 63 64 controller = Path.sched_control 64 65 inventory_info = _("Info") … … 836 837 # check for database changes 837 838 prev_stat = self.db_stat 838 possibly_new = os.stat(umitdb).st_mtime 839 try: 840 possibly_new = os.stat(umitdb).st_mtime 841 except OSError: 842 return True 843 839 844 if prev_stat != possibly_new: 840 845 #print "db changed" … … 844 849 # check for changes in schemas 845 850 prev_state = self.schema_stat 846 possibly_new = os.stat(Path.sched_schemas).st_mtime 851 try: 852 possibly_new = os.stat(Path.sched_schemas).st_mtime 853 except OSError: 854 return True 855 847 856 if prev_state != possibly_new: 848 857 #print "schemas changed" … … 857 866 Set window properties. 858 867 """ 859 self.set_title(_("UMIT Network Inventory 0.1.5"))868 self.set_title(_("UMIT Network Inventory %s" % NI_VER)) 860 869 # a size for testing 861 870 self.set_position(gtk.WIN_POS_CENTER)
