Changeset 5566
- Timestamp:
- 03/29/10 22:25:59 (3 years ago)
- Location:
- trunk/umit/core
- Files:
-
- 4 modified
-
NmapCommand.py (modified) (5 diffs)
-
NmapParser.py (modified) (1 diff)
-
SearchResult.py (modified) (2 diffs)
-
UmitConf.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/umit/core/NmapCommand.py
r4479 r5566 26 26 import threading 27 27 import tempfile 28 from types import StringTypes29 28 30 29 from umit.core.NmapOptions import NmapOptions … … 112 111 113 112 def get_command(self): 114 if type(self._command) == type(""):113 if isinstance(self._command, basestring): 115 114 return self._command.split() 116 115 return self._command … … 127 126 128 127 def _verify_output_options(self, command): 129 if type(command) == type([]):128 if isinstance(command, list): 130 129 command = " ".join(command) 131 130 … … 167 166 168 167 def _remove_double_space(self, command): 169 if type(command) == type([]):168 if isinstance(command, list): 170 169 command = " ".join(command) 171 170 … … 349 348 args, level = self.options[option_name] 350 349 351 if type(args) in StringTypes:350 if isinstance(args, basestring): 352 351 args = [args] 353 352 -
trunk/umit/core/NmapParser.py
r5096 r5566 381 381 382 382 def set_date(self, date): 383 if type(date) == type(int):383 if isinstance(date, int): 384 384 self.nmap['nmaprun']['start'] = date 385 385 else: -
trunk/umit/core/SearchResult.py
r5134 r5566 27 27 from fnmatch import fnmatch 28 28 from tempfile import mktemp 29 from types import StringTypes30 29 31 30 from umit.core.UmitDB import UmitDB … … 287 286 self.search_directory = search_directory 288 287 289 if type(file_extensions) in StringTypes:288 if isinstance(file_extensions, basestring): 290 289 self.file_extensions = file_extensions.split(";") 291 elif type(file_extensions) == type([]):290 elif isinstance(file_extensions, list): 292 291 self.file_extensions = file_extensions 293 292 else: -
trunk/umit/core/UmitConf.py
r5535 r5566 24 24 import os 25 25 26 from types import StringTypes27 26 from ConfigParser import NoSectionError, NoOptionError, DuplicateSectionError 28 27 … … 118 117 119 118 def set_file_extension(self, file_extension): 120 if type(file_extension) == type([]):119 if isinstance(file_extension, list): 121 120 self._set_it("file_extension", ";".join(file_extension)) 122 elif type(file_extension) in StringTypes:121 elif isinstance(file_extension, basestring): 123 122 self._set_it("file_extension", file_extension) 124 123 … … 127 126 128 127 def set_save_time(self, save_time): 129 if type(save_time) == type([]):128 if isinstance(save_time, list): 130 129 self._set_it("save_time", ";".join(save_time)) 131 elif type(save_time) in StringTypes:130 elif isinstance(save_time, basestring): 132 131 self._set_it("save_time", save_time) 133 132 … … 342 341 343 342 tuple_regex = "[\(\[]\s?(\d+)\s?,\s?(\d+)\s?,\s?(\d+)\s?[\)\]]" 344 if type(settings[3]) == type(""):343 if isinstance(settings[3], basestring): 345 344 settings[3] = [int(t) \ 346 345 for t in re.findall(tuple_regex, settings[3])[0]] 347 346 348 if type(settings[4]) == type(""):347 if isinstance(settings[4], basestring): 349 348 settings[4]= [int(h) \ 350 349 for h in re.findall(tuple_regex, settings[4])[0]] … … 520 519 521 520 tuple_regex = "[\(\[]\s?(\d+)\s?,\s?(\d+)\s?,\s?(\d+)\s?[\)\]]" 522 if type(settings) == type(""):521 if isinstance(settings, basestring): 523 522 settings = [int(t) for t in re.findall(tuple_regex, settings)[0]] 524 523
