def update(self): try: self.nmap_options = NmapOptions(options_file) self.options = self.nmap_options.get_options_list() self.options.sort() self.clean_model() model = self.get_model() for o in self.options: model.append([o]) except: pass
def __init__(self, xml_file, constructor, update_func): """ OptionBuilder(xml_file, constructor) xml_file is a UI description xml-file constructor is a CommandConstructor instance """ xml_desc = open(xml_file) self.xml = minidom.parse(xml_desc) # Closing file to avoid problems with file descriptors xml_desc.close() self.constructor = constructor self.update_func = update_func self.root_tag = "interface" self.xml = self.xml.getElementsByTagName(self.root_tag)[0] self.options = NmapOptions(options_file) self.groups = self.__parse_groups() self.section_names = self.__parse_section_names() self.tabs = self.__parse_tabs()
def __init__(self, xml_file): ''' Open XML file It should be inheritance of OptionBuilder But I don't need a function that update command. So I implement a new way of read elements like OptionBuilder with support of write in XML @param xml_file: String with a path of file @type xml_file: str ''' xml_desc = open(xml_file) self.xml_parse = minidom.parse(xml_desc) xml_desc.close() self.root_tag = "interface" self.xml = self.xml_parse.getElementsByTagName(self.root_tag)[0] self.options = NmapOptions(options) self.groups = self.__parse_groups() self.section_names = self.__parse_section_names() self.tabs = self.__parse_tabs()
def __init__(self): self.r_scans = RecentScans() self.t_list = TargetList() self.nmap_options = NmapOptions(options_file)