本文整理汇总了Python中higwidgets.higtables.HIGTable.set_border_width方法的典型用法代码示例。如果您正苦于以下问题:Python HIGTable.set_border_width方法的具体用法?Python HIGTable.set_border_width怎么用?Python HIGTable.set_border_width使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类higwidgets.higtables.HIGTable
的用法示例。
在下文中一共展示了HIGTable.set_border_width方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_scan_infos
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import set_border_width [as 别名]
def set_scan_infos(self, scan_info):
for scan in scan_info:
exp = gtk.Expander('<b>%s - %s</b>' % (_('Scan Info'),
scan['type'].capitalize()))
exp.set_use_markup(True)
hbox = HIGHBox()
table = HIGTable()
table.set_border_width(5)
table.set_row_spacings(6)
table.set_col_spacings(6)
table.attach(HIGEntryLabel(_('Scan type:')),0,1,0,1)
table.attach(HIGEntryLabel(scan['type']),1,2,0,1)
table.attach(HIGEntryLabel(_('Protocol:')),0,1,1,2)
table.attach(HIGEntryLabel(scan['protocol']),1,2,1,2)
table.attach(HIGEntryLabel(_('# scanned ports:')),0,1,2,3)
table.attach(HIGEntryLabel(scan['numservices']),1,2,2,3)
table.attach(HIGEntryLabel(_('Services:')),0,1,3,4)
table.attach(self.get_service_view(scan['services'].split(',')),\
1,2,3,4)
hbox._pack_noexpand_nofill(hig_box_space_holder())
hbox._pack_noexpand_nofill(table)
exp.add (hbox)
self._pack_noexpand_nofill(exp)
示例2: NmapOutputProperties
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import set_border_width [as 别名]
class NmapOutputProperties(HIGDialog):
def __init__(self, nmap_output_view):
HIGDialog.__init__(self, _("Nmap Output Properties"),
buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
self.nmap_highlight = NmapOutputHighlight()
self.__create_widgets()
self.__pack_widgets()
self.highlight_tab()
self.vbox.show_all()
def __create_widgets(self):
self.properties_notebook = HIGNotebook()
def __pack_widgets(self):
self.vbox.pack_start(self.properties_notebook)
def highlight_tab(self):
# Creating highlight tab main box
self.highlight_main_vbox = HIGVBox()
# Creating highlight tab main table
self.highlight_main_table = HIGTable()
self.highlight_main_table.set_border_width(6)
#############
# Properties:
self.property_names = {"details": [_("details"), "MAC Address:"],
"port_list": [_("port listing title"),
"PORT STATE SERVICE"],
"open_port": [_("open port"),
"22/tcp open ssh"],
"closed_port": [_("closed port"),
"70/tcp closed gopher"],
"filtered_port": [_("filtered port"),
"80/tcp filtered http"],
"date": [_("date"),
"2006-05-26 11:14 BRT"],
"hostname": [_("hostname"),
"scanme.nmap.org"],
"ip": [_("ip"),
"127.0.0.1"]}
for p in self.property_names:
settings = self.nmap_highlight.__getattribute__(p)
self.property_names[p].append(settings[0])
self.property_names[p].append(settings[1])
self.property_names[p].append(settings[2])
self.property_names[p].append(gtk.gdk.Color(*settings[3]))
self.property_names[p].append(gtk.gdk.Color(*settings[4]))
self.property_names[p].append(settings[5])
# Creating properties and related widgets and attaching it to main table
y1 = 0
y2 = 1
for p in self.property_names:
hp = HighlightProperty(p, self.property_names[p])
self.highlight_main_table.attach(hp.property_name_label,
0, 1, y1, y2)
self.highlight_main_table.attach(hp.example_label,
1, 2, y1, y2)
self.highlight_main_table.attach(hp.bold_tg_button,
2, 3, y1, y2)
self.highlight_main_table.attach(hp.italic_tg_button,
3, 4, y1, y2)
self.highlight_main_table.attach(hp.underline_tg_button,
4, 5, y1, y2)
self.highlight_main_table.attach(hp.text_color_button,
5, 6, y1, y2)
self.highlight_main_table.attach(hp.highlight_color_button,
6, 7, y1, y2)
# Setting example styles and colors
hp.update_example()
self.property_names[p].append(hp)
y1 += 1
y2 += 1
# Packing main table into main vbox
self.highlight_main_vbox.pack_start(self.highlight_main_table)
# Adding color tab
self.properties_notebook.append_page(self.highlight_main_vbox,
gtk.Label(_("Highlight definitions")))
示例3: GeneralSettings
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import set_border_width [as 别名]
class GeneralSettings(TabBox, object):
"""
General Settings
- Splash enable/disable
- Warnings
- Erros, log, configure bugreport
- Autosave: clean up, define folder etc
- Define Nmap Command
"""
def __init__(self, name):
TabBox.__init__(self, name)
def _create_widgets(self):
"""
Design all
"""
# Create general widgets
self._create_widgets_common()
self._create_widgets_autosave()
self._create_widgets_error()
# Packing main section
self.pack_start(self._box_common, False, False)
self.pack_start(self._box_error_frame, False, False)
self.pack_start(self._box_save_frame, False, False)
self._box_error_frame.set_shadow_type(gtk.SHADOW_NONE)
self._box_error_frame.set_shadow_type(gtk.SHADOW_NONE)
# Settings Values
self.splash = general_settings.splash
self.warnings_extensions = general_settings.warnings_extensions
self.silent_root = general_settings.silent_root
self.crash_report = general_settings.crash_report
self.log = general_settings.log
self.log_file = general_settings.log_file
self.warnings_save = general_settings.warnings_save
self._connect_events()
def _create_widgets_common(self):
""" generally tab """
self._box_common = HIGVBox() # pack main section
self.__check_splash = gtk.CheckButton(_('Enable Splash on start'))
self.__check_silent_root = gtk.CheckButton(\
_('Silent Warning Non-Root'))
self.__check_warning_extensions = gtk.CheckButton(\
_('Set/Check extensions - Windows only'))
self._box_common.pack_start(self.__check_splash, False, False)
#self._box_common.pack_start(self.__check_warning_extensions, False, \
# False)
self._box_common.pack_start(self.__check_silent_root, False, False)
self.__label_nmap = HIGEntryLabel(_('Nmap Command'))
self.__entry_nmap = HIGTextEntry()
# Files usr saved on predefined directory:
self.__label_path = HIGEntryLabel(_('Nmap Command'))
self.__entry_path = HIGTextEntry()
self.__button_path = HIGButton(_('Choose'))
self.__box_path = HIGHBox()
self.__box_path.pack_start(self.__label_path, False, False)
self.__box_path.pack_end(self.__button_path, False, False)
self._box_common.set_border_width(0)
def _create_widgets_error(self):
# Create Widgets
self._box_error_frame = HIGFrame('Error')
self._box_error = HIGTable(5, 2)
self._box_error.set_border_width(10)
self._box_error_frame.add(self._box_error)
self.__crash_report = gtk.CheckButton(_('Enable Crash Report'))
# Radio Button List
self.__log_no = gtk.RadioButton(None, _('No log'))
self.__log_terminal = gtk.RadioButton(self.__log_no, _('Enable log in terminal'))
self.__log_file = gtk.RadioButton(self.__log_terminal,\
_('Enable log file'))
self.__log_file_label = HIGEntryLabel(_('Log file'))
self.__log_file_entry = HIGTextEntry()
self.__log_file_entry.set_editable(False)
# FIXME: Do default file ~/.umit/umit.log
self.__log_file_browser = HIGButton(_('Browse file'), \
gtk.STOCK_DIRECTORY)
tmpbox = HIGHBox()
tmpbox.pack_start(self.__log_file_entry, False, False)
tmpbox.pack_start(self.__log_file_browser, False, False)
# attach table
self._box_error.attach(self.__crash_report, 0,1,0,1,\
gtk.FILL|gtk.EXPAND| gtk.SHRINK, gtk.FILL)
self._box_error.attach(self.__log_no, 0,1,1,2,\
gtk.FILL|gtk.EXPAND| gtk.SHRINK, gtk.FILL)
#.........这里部分代码省略.........
示例4: ScanRunDetailsPage
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import set_border_width [as 别名]
class ScanRunDetailsPage(HIGVBox):
def __init__(self):
HIGVBox.__init__(self)
self.__create_widgets()
def __create_widgets(self):
na = _('Not available')
self.command_expander = gtk.Expander("<b>"+_("Command Info")+"</b>")
self.general_expander = gtk.Expander("<b>"+_("General Info")+"</b>")
# Command info
self.command_label = HIGEntryLabel(_('Command:'))
self.info_command_label = HIGEntryLabel(na)
self.nmap_version_label = HIGEntryLabel(_('Nmap Version:'))
self.info_nmap_version_label = HIGEntryLabel(na)
self.verbose_label = HIGEntryLabel(_('Verbosity level:'))
self.info_verbose_label = HIGEntryLabel(na)
self.debug_label = HIGEntryLabel(_('Debug level:'))
self.info_debug_label = HIGEntryLabel(na)
self.command_table = HIGTable()
self.command_hbox = HIGHBox()
# General info:
self.start_label = HIGEntryLabel(_('Started on:'))
self.info_start_label = HIGEntryLabel(na)
self.finished_label = HIGEntryLabel(_('Finished on:'))
self.info_finished_label = HIGEntryLabel(na)
self.host_up_label = HIGEntryLabel(_('Hosts up:'))
self.info_hosts_up_label = HIGEntryLabel(na)
self.host_down_label = HIGEntryLabel(_('Hosts down:'))
self.info_hosts_down_label = HIGEntryLabel(na)
self.host_scanned_label = HIGEntryLabel(_('Hosts scanned:'))
self.info_hosts_scanned_label = HIGEntryLabel(na)
self.open_label = HIGEntryLabel(_('Open ports:'))
self.info_open_label = HIGEntryLabel(na)
self.filtered_label = HIGEntryLabel(_('Filtered ports:'))
self.info_filtered_label = HIGEntryLabel(na)
self.closed_label = HIGEntryLabel(_('Closed ports:'))
self.info_closed_label = HIGEntryLabel(na)
self.general_table = HIGTable()
self.general_hbox = HIGHBox()
def set_command_info(self, info):
# Fix aligment!
self.command_expander.set_use_markup(True)
self.command_table.set_border_width(5)
self.command_table.set_row_spacings(6)
self.command_table.set_col_spacings(6)
try:self.info_command_label.set_text(info['command'])
except:pass
try:self.info_nmap_version_label.set_text(info['version'])
except:pass
try:self.info_verbose_label.set_text(info['verbose'])
except:pass
try:self.info_debug_label.set_text(info['debug'])
except:pass
self.command_hbox._pack_noexpand_nofill(hig_box_space_holder())
self.command_hbox._pack_noexpand_nofill(self.command_table)
self.command_table.attach(self.command_label,0,1,0,1)
self.command_table.attach(self.info_command_label,1,2,0,1)
self.command_table.attach(self.nmap_version_label,0,1,1,2)
self.command_table.attach(self.info_nmap_version_label,1,2,1,2)
self.command_table.attach(self.verbose_label,0,1,2,3)
self.command_table.attach(self.info_verbose_label,1,2,2,3)
self.command_table.attach(self.debug_label,0,1,3,4)
self.command_table.attach(self.info_debug_label,1,2,3,4)
self.command_expander.add(self.command_hbox)
self._pack_noexpand_nofill(self.command_expander)
self.command_expander.set_expanded(True)
def set_general_info(self, info):
# Fix aligment!
self.general_expander.set_use_markup(True)
self.general_table.set_border_width(5)
self.general_table.set_row_spacings(6)
self.general_table.set_col_spacings(6)
#.........这里部分代码省略.........
示例5: BoxEditable
# 需要导入模块: from higwidgets.higtables import HIGTable [as 别名]
# 或者: from higwidgets.higtables.HIGTable import set_border_width [as 别名]
class BoxEditable(HIGVBox):
def __init__(self, section_name, profile, listoptions, notebook_parent, new=False):
"""
A Box Editable contains a options of each tab
@param section_name: section name <tab>
@type section_name: str
@param profile: A class that view and modify xml file
@type profile: ProfileCore
@param listoptions: The List of Options to update XML (I guess to confirm)
@type listoptions: ListOptions
@param notebook_parent: Notebook
@type notebook_parent: Notebook or Subclass
@param new: It's a new tab or not
@type new: bool
"""
HIGVBox.__init__(self)
self._coords = {}
self._parent = notebook_parent
self._last = None
#Profile Core do a manage at profile_editor.xml file
self._profilecore = None
self._profile = profile
self._listoptions = listoptions
self._table = HIGTable()
self._section_name = section_name
if not new :
self._options = self._profile.get_section(section_name)
self._table.set_border_width(3)
c = self.get_colormap()
color = c.alloc_color(0,0,0)
self._table.modify_fg(gtk.STATE_NORMAL,color )
#self._fill_table()
box_tmp = HIGVBox()
box_tmp.pack_start(self._table, False, False)
self._sw = HIGScrolledWindow()
#self._sw.set_size_request(400,200)
vp = gtk.Viewport()
vp.add(box_tmp)
vp.set_shadow_type(gtk.SHADOW_NONE)
self._sw.add(vp)
self.pack_start(self._sw, True, True)
self._old_selected = None
self._x = 0
self._y = 0
self.connect('button-press-event', self._bp)
#Private API
def _bp(self, widget,event):
pass
def _fill_table(self):
k = 0
self._old_po = None
for i in self._options:
t = SpecialHBox()
type = i.get_type()
if type== 'option_check':
name_option = i.get_option()
hint = self._listoptions.get_hint(name_option)
tmp_widget = OptionCheckIcon(i.get_label(),name_option,hint)
t.pack_start(tmp_widget)
arg_type = self._listoptions.get_arg_type(name_option)
if arg_type!= '':
additional = type_mapping[arg_type]()
t.pack_start(additional)
po = ProfileOption('option_check', i.get_label(),name_option,
arg_type,None)
po.set_section(self.get_name())
t.set_profileoption(po)
elif type == 'option_list':
eventbox = gtk.EventBox()
label = HIGEntryLabel(i.get_label())
eventbox.add(label)
tmp_widget = OptionList()
list = []
for j in i.get_option_list():
d = {}
d['name'] = j
tmp_widget.append(d)
list.append(j)
po = ProfileOption('option_list', i.get_label(),i.get_label(),
None,list)
po.set_section(self.get_name())
t.set_profileoption(po)
t.pack_start(eventbox)
t.pack_start(tmp_widget)
#t.drag_source_set(gtk.gdk.BUTTON1_MASK |
#gtk.gdk.BUTTON3_MASK,
#target,
#gtk.gdk.ACTION_COPY |
#gtk.gdk.ACTION_MOVE)
#t.connect('drag_data_get', self.source_drag_data_get)
#.........这里部分代码省略.........