Changeset 4479
- Timestamp:
- 04/10/09 01:25:05 (4 years ago)
- Location:
- trunk/umit
- Files:
-
- 17 modified
-
core/NmapCommand.py (modified) (1 diff)
-
core/NmapOptions.py (modified) (1 diff)
-
core/OSList.py (modified) (1 diff)
-
core/Scheduler.py (modified) (2 diffs)
-
core/UmitConf.py (modified) (2 diffs)
-
core/UmitDB.py (modified) (3 diffs)
-
gui/DiffCompare.py (modified) (1 diff)
-
gui/OptionBuilder.py (modified) (1 diff)
-
gui/ScanNotebook.py (modified) (3 diffs)
-
gui/ScriptManager.py (modified) (1 diff)
-
gui/SearchGUI.py (modified) (1 diff)
-
gui/radialnet/Image.py (modified) (1 diff)
-
gui/radialnet/RadialNet.py (modified) (2 diffs)
-
inventory/DataGrabber.py (modified) (1 diff)
-
inventory/InventoryLoad.py (modified) (1 diff)
-
inventory/TLBarDisplay.py (modified) (1 diff)
-
inventory/TLChangesTree.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/umit/core/NmapCommand.py
r4240 r4479 339 339 340 340 def remove_option(self, option_name): 341 if option_name in self.options .keys():341 if option_name in self.options: 342 342 self.options.pop(option_name) 343 343 -
trunk/umit/core/NmapOptions.py
r4240 r4479 110 110 111 111 def __get_list (self, dict): 112 return [element for element in dict.keys()]112 return dict.keys() 113 113 114 114 -
trunk/umit/core/OSList.py
r4240 r4479 36 36 37 37 def get_match_list(self, osclass): 38 if osclass in self.os .keys():38 if osclass in self.os: 39 39 return self.os[osclass] 40 40 return None -
trunk/umit/core/Scheduler.py
r4240 r4479 245 245 if self.schema_parser.has_section(name): 246 246 for opt in self.schema_parser.options(name): 247 if opt in self.options .keys():247 if opt in self.options: 248 248 self.options[opt](self.schema_parser.get(name, opt)) 249 249 … … 260 260 if p_cfg.has_section(self.profile): 261 261 for opt in p_cfg.options(self.profile): 262 if opt in self.profile_opts .keys():262 if opt in self.profile_opts: 263 263 self.profile_opts[opt](p_cfg.get(self.profile, opt)) 264 264 -
trunk/umit/core/UmitConf.py
r4240 r4479 211 211 options = {} 212 212 elif isinstance(options, dict): 213 self._set_it(profile_name, "options", ",".join(options .keys()))213 self._set_it(profile_name, "options", ",".join(options)) 214 214 215 215 for opt in options: … … 276 276 if options[opt]: 277 277 self._set_it(profile, opt, options[opt]) 278 self._set_it(profile, 'options', ",".join(options .keys()))278 self._set_it(profile, 'options', ",".join(options)) 279 279 280 280 def get_profile(self, profile_name): -
trunk/umit/core/UmitDB.py
r4475 r4479 120 120 def insert(self, **kargs): 121 121 sql = "INSERT INTO %s (" 122 for k in kargs .keys():122 for k in kargs: 123 123 sql += k 124 124 sql += ", " … … 199 199 def __init__(self, **kargs): 200 200 Table.__init__(self, "scans") 201 if "scans_id" in kargs .keys():201 if "scans_id" in kargs: 202 202 self.scans_id = kargs["scans_id"] 203 203 else: … … 205 205 fields = ["scan_name", "nmap_xml_output", "date"] 206 206 207 for k in kargs .keys():207 for k in kargs: 208 208 if k not in fields: 209 209 raise Exception("Wrong table field passed to creation \ 210 210 method. '%s'" % k) 211 211 212 if "nmap_xml_output" not in kargs .keys()or \212 if "nmap_xml_output" not in kargs or \ 213 213 not kargs["nmap_xml_output"]: 214 214 raise Exception("Can't save result without xml output") -
trunk/umit/gui/DiffCompare.py
r4470 r4479 183 183 scan_id = 1 184 184 new_scan_name = scan_name 185 while new_scan_name in self.scan_dict .keys():185 while new_scan_name in self.scan_dict: 186 186 new_scan_name = "%s (%s)" % (scan_name, scan_id) 187 187 scan_id += 1 -
trunk/umit/gui/OptionBuilder.py
r4298 r4479 57 57 except:pass 58 58 else: 59 if option_element.tagName in actions .keys():59 if option_element.tagName in actions: 60 60 self.widgets_list.append( 61 61 actions[option_element.tagName](option_element, -
trunk/umit/gui/ScanNotebook.py
r4476 r4479 786 786 continue 787 787 788 if name not in self.services .keys():788 if name not in self.services: 789 789 self.services[name] = {"hosts":[]} 790 790 … … 882 882 current_ip = match_host.groups()[0] 883 883 if match_os: 884 if current_ip not in fingerprints .keys():884 if current_ip not in fingerprints: 885 885 fingerprints[current_ip] = {} 886 886 887 887 fingerprints[current_ip]["os"] = match_os.groups()[0] 888 888 if match_service: 889 if current_ip not in fingerprints .keys():889 if current_ip not in fingerprints: 890 890 fingerprints[current_ip] = {} 891 891 … … 911 911 """ 912 912 913 key_num = len(fingerprints .keys())913 key_num = len(fingerprints) 914 914 dialog_text = ("Umit has found that %s. The submission and " 915 915 "registration of fingerprints are very important for you " -
trunk/umit/gui/ScriptManager.py
r4240 r4479 199 199 200 200 def get_selected(self): 201 return ";".join([script.path for script in self.d .keys()if self.d[script]])201 return ";".join([script.path for script in self.d if self.d[script]]) 202 202 203 203 def is_selected(self, script): -
trunk/umit/gui/SearchGUI.py
r4240 r4479 887 887 self.entry.set_width_chars(4) 888 888 889 for i in SearchConfig().time_list .keys():889 for i in SearchConfig().time_list: 890 890 self.time_list.append([i]) 891 891 -
trunk/umit/gui/radialnet/Image.py
r4240 r4479 47 47 return False 48 48 49 if icon + image_type not in self.__cache .keys():49 if icon + image_type not in self.__cache: 50 50 51 51 file = self.get_icon(icon, image_type) -
trunk/umit/gui/radialnet/RadialNet.py
r4240 r4479 672 672 x, y = point 673 673 674 if node in self.__node_views .keys():674 if node in self.__node_views: 675 675 676 676 self.__node_views[node].restore(int(xw + x), int(yw + y)) … … 1048 1048 icons = list() 1049 1049 1050 if type in ICON_DICT .keys():1050 if type in ICON_DICT: 1051 1051 icons.append(self.__icon.get_pixbuf(ICON_DICT[type])) 1052 1052 -
trunk/umit/inventory/DataGrabber.py
r4277 r4479 103 103 104 104 # grab data 105 for category in categories .keys():105 for category in categories: 106 106 # unused is a filter that we will discard, it is a filter 107 107 # for Changes Sum, but we will return a filter by category. -
trunk/umit/inventory/InventoryLoad.py
r4277 r4479 90 90 91 91 # Retrieve hosts for each Inventory 92 for inv in inv_data .keys():92 for inv in inv_data: 93 93 invid = self.get_inventory_id_for_name(inv) 94 94 -
trunk/umit/inventory/TLBarDisplay.py
r4240 r4479 144 144 145 145 # grab changes by category in current selection 146 for key in categories .keys():146 for key in categories: 147 147 c = self.datagrabber.timerange_changes_count_generic(range_start, 148 148 range_end, key, self.datagrabber.inventory, -
trunk/umit/inventory/TLChangesTree.py
r4277 r4479 151 151 # grab changes in timerange 152 152 self.datagrabber.use_dict_cursor() 153 for key in db_categories .keys():153 for key in db_categories: 154 154 if not range_start or not range_end: 155 155 data[key] = { } … … 178 178 179 179 # grab host address 180 if not fk_address in addresses .keys():180 if not fk_address in addresses: 181 181 adr = self.datagrabber.get_address_for_address_id_from_db( 182 182 fk_address) … … 185 185 186 186 # grab inventory name 187 if not fk_inventory in inventories .keys():187 if not fk_inventory in inventories: 188 188 inv_name = self.datagrabber.get_inventory_name_for_id( 189 189 fk_inventory)
