def show_output_properties(self, widget): nmap_out_prop = NmapOutputProperties(self.text_view) nmap_out_prop.run() for prop in nmap_out_prop.property_names: widget = nmap_out_prop.property_names[prop][8] wid_props = [] if widget.bold: wid_props.append(1) else: wid_props.append(0) if widget.italic: wid_props.append(1) else: wid_props.append(0) if widget.underline: wid_props.append(1) else: wid_props.append(0) wid_props.append("(%s, %s, %s)" % (widget.text_color.red, widget.text_color.green, widget.text_color.blue)) wid_props.append("(%s, %s, %s)" % (widget.highlight_color.red, widget.highlight_color.green, widget.highlight_color.blue)) self.nmap_highlight.__setattr__(widget.property_name, wid_props) nmap_out_prop.destroy() try: self.nmap_highlight.save_changes() except IOError as e: if e.errno == errno.EACCES: alert = HIGAlertDialog( message_format=_("Can't save Zenmap configuration"), secondary_text=_( 'Permission denied when writing to \n%s' '\nMake sure the file exists and is writable.' ) % (Path.user_config_file)) alert.run() alert.destroy() else: raise self.apply_highlighting()
def show_output_properties(self, widget): nmap_out_prop = NmapOutputProperties(self.text_view) nmap_out_prop.run() for prop in nmap_out_prop.property_names: widget = nmap_out_prop.property_names[prop][8] wid_props = [] if widget.bold: wid_props.append(1) else: wid_props.append(0) if widget.italic: wid_props.append(1) else: wid_props.append(0) if widget.underline: wid_props.append(1) else: wid_props.append(0) wid_props.append("(%s, %s, %s)" % (widget.text_color.red, widget.text_color.green, widget.text_color.blue)) wid_props.append("(%s, %s, %s)" % (widget.highlight_color.red, widget.highlight_color.green, widget.highlight_color.blue)) self.nmap_highlight.__setattr__(widget.property_name, wid_props) nmap_out_prop.destroy() self.nmap_highlight.save_changes() self.apply_highlighting()
def show_output_properties(self, widget): nmap_out_prop = NmapOutputProperties(self.text_view) nmap_out_prop.run() for prop in nmap_out_prop.property_names: widget = nmap_out_prop.property_names[prop][8] wid_props = [] if widget.bold: wid_props.append(1) else: wid_props.append(0) if widget.italic: wid_props.append(1) else: wid_props.append(0) if widget.underline: wid_props.append(1) else: wid_props.append(0) wid_props.append("(%s, %s, %s)" % (widget.text_color.red, widget.text_color.green, widget.text_color.blue)) wid_props.append( "(%s, %s, %s)" % (widget.highlight_color.red, widget.highlight_color.green, widget.highlight_color.blue)) self.nmap_highlight.__setattr__(widget.property_name, wid_props) nmap_out_prop.destroy() try: self.nmap_highlight.save_changes() except IOError as e: if e.errno == errno.EACCES: alert = HIGAlertDialog( message_format=_("Can't save Zenmap configuration"), secondary_text=_( 'Permission denied when writing to \n%s' '\nMake sure the file exists and is writable.') % (Path.user_config_file)) alert.run() alert.destroy() else: raise self.apply_highlighting()
def show_output_properties(self, widget): nmap_out_prop = NmapOutputProperties(self.text_view) nmap_out_prop.run() for prop in nmap_out_prop.property_names: widget = nmap_out_prop.property_names[prop][8] wid_props = [] if widget.bold: wid_props.append(1) else: wid_props.append(0) if widget.italic: wid_props.append(1) else: wid_props.append(0) if widget.underline: wid_props.append(1) else: wid_props.append(0) wid_props.append("(%s, %s, %s)" % (widget.text_color.red, widget.text_color.green, widget.text_color.blue)) wid_props.append( "(%s, %s, %s)" % (widget.highlight_color.red, widget.highlight_color.green, widget.highlight_color.blue)) self.nmap_highlight.__setattr__(widget.property_name, wid_props) nmap_out_prop.destroy() self.nmap_highlight.save_changes() self.apply_highlighting()