當前位置: 首頁>>代碼示例>>Python>>正文


Python expanders.BWExpander類代碼示例

本文整理匯總了Python中radialnet.bestwidgets.expanders.BWExpander的典型用法代碼示例。如果您正苦於以下問題:Python BWExpander類的具體用法?Python BWExpander怎麽用?Python BWExpander使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了BWExpander類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

    def __init__(self, radialnet):
        """
        """
        BWExpander.__init__(self, _("Layout"))

        self.radialnet = radialnet

        self.__create_widgets()
開發者ID:trevordavenport,項目名稱:nmap,代碼行數:8,代碼來源:ControlWidget.py

示例2: __create_widgets

    def __create_widgets(self):
        """
        """
        self.__vbox = BWVBox()
        self.__vbox.set_border_width(6)

        self.__cell = gtk.CellRendererText()

        self.__general_frame = BWExpander(_('General information'))
        self.__sequences_frame = BWExpander(_('Sequences'))
        self.__os_frame = BWExpander(_('Operating System'))

        self.__sequences_frame.bw_add(gtk.Label(_('No sequence information.')))
        self.__os_frame.bw_add(gtk.Label(_('No OS information.')))

        # general information widgets
        self.__general = BWTable(3, 2)

        self.__address_label = BWSectionLabel(_('Address:'))
        self.__address_list = gtk.combo_box_entry_new_text()
        self.__address_list.child.set_editable(False)

        for address in self.__node.get_info('addresses'):

            params = address['type'], address['addr']
            address_text = SYSTEM_ADDRESS_TEXT % params

            if address['vendor'] is not None and address['vendor'] != '':
                address_text += " (%s)" % address['vendor']

            self.__address_list.append_text(address_text)

        self.__address_list.set_active(0)

        self.__general.bw_attach_next(self.__address_label,
                                      yoptions=gtk.FILL,
                                      xoptions=gtk.FILL)
        self.__general.bw_attach_next(self.__address_list, yoptions=gtk.FILL)

        if self.__node.get_info('hostnames') is not None:

            self.__hostname_label = BWSectionLabel(_('Hostname:'))
            self.__hostname_list = gtk.combo_box_entry_new_text()
            self.__hostname_list.child.set_editable(False)

            for hostname in self.__node.get_info('hostnames'):

                params = hostname['type'], hostname['name']
                self.__hostname_list.append_text(SYSTEM_ADDRESS_TEXT % params)

            self.__hostname_list.set_active(0)

            self.__general.bw_attach_next(self.__hostname_label,
                                          yoptions=gtk.FILL,
                                          xoptions=gtk.FILL)
            self.__general.bw_attach_next(self.__hostname_list,
                                          yoptions=gtk.FILL)

        if self.__node.get_info('uptime') is not None:

            self.__uptime_label = BWSectionLabel(_('Last boot:'))

            seconds = self.__node.get_info('uptime')['seconds']
            lastboot = self.__node.get_info('uptime')['lastboot']

            text = _('%s (%s seconds).') % (lastboot, seconds)

            self.__uptime_value = BWLabel(text)
            self.__uptime_value.set_selectable(True)
            self.__uptime_value.set_line_wrap(False)

            self.__general.bw_attach_next(self.__uptime_label,
                                          yoptions=gtk.FILL,
                                          xoptions=gtk.FILL)
            self.__general.bw_attach_next(self.__uptime_value,
                                          yoptions=gtk.FILL)

        self.__general_frame.bw_add(self.__general)
        self.__general_frame.set_expanded(True)

        sequences = self.__node.get_info('sequences')
        if len(sequences) > 0:
            self.__sequences_frame.bw_add(
                    self.__create_sequences_widget(sequences))

        # operating system information widgets
        self.__os = gtk.Notebook()

        os = self.__node.get_info('os')

        if os is not None:

            if 'matches' in os:

                self.__match_scroll = BWScrolledWindow()

                self.__match_store = gtk.ListStore(gobject.TYPE_STRING,
                                                   gobject.TYPE_STRING,
                                                   gobject.TYPE_INT,
                                                   gobject.TYPE_BOOLEAN)
#.........這裏部分代碼省略.........
開發者ID:mogigoma,項目名稱:nmap,代碼行數:101,代碼來源:NodeNotebook.py

示例3: SystemPage

class SystemPage(BWScrolledWindow):
    """
    """
    def __init__(self, node):
        """
        """
        BWScrolledWindow.__init__(self)

        self.__node = node
        self.__font = pango.FontDescription('Monospace')

        self.__create_widgets()

    def __create_widgets(self):
        """
        """
        self.__vbox = BWVBox()
        self.__vbox.set_border_width(6)

        self.__cell = gtk.CellRendererText()

        self.__general_frame = BWExpander(_('General information'))
        self.__sequences_frame = BWExpander(_('Sequences'))
        self.__os_frame = BWExpander(_('Operating System'))

        self.__sequences_frame.bw_add(gtk.Label(_('No sequence information.')))
        self.__os_frame.bw_add(gtk.Label(_('No OS information.')))

        # general information widgets
        self.__general = BWTable(3, 2)

        self.__address_label = BWSectionLabel(_('Address:'))
        self.__address_list = gtk.combo_box_entry_new_text()
        self.__address_list.child.set_editable(False)

        for address in self.__node.get_info('addresses'):

            params = address['type'], address['addr']
            address_text = SYSTEM_ADDRESS_TEXT % params

            if address['vendor'] is not None and address['vendor'] != '':
                address_text += " (%s)" % address['vendor']

            self.__address_list.append_text(address_text)

        self.__address_list.set_active(0)

        self.__general.bw_attach_next(self.__address_label,
                                      yoptions=gtk.FILL,
                                      xoptions=gtk.FILL)
        self.__general.bw_attach_next(self.__address_list, yoptions=gtk.FILL)

        if self.__node.get_info('hostnames') is not None:

            self.__hostname_label = BWSectionLabel(_('Hostname:'))
            self.__hostname_list = gtk.combo_box_entry_new_text()
            self.__hostname_list.child.set_editable(False)

            for hostname in self.__node.get_info('hostnames'):

                params = hostname['type'], hostname['name']
                self.__hostname_list.append_text(SYSTEM_ADDRESS_TEXT % params)

            self.__hostname_list.set_active(0)

            self.__general.bw_attach_next(self.__hostname_label,
                                          yoptions=gtk.FILL,
                                          xoptions=gtk.FILL)
            self.__general.bw_attach_next(self.__hostname_list,
                                          yoptions=gtk.FILL)

        if self.__node.get_info('uptime') is not None:

            self.__uptime_label = BWSectionLabel(_('Last boot:'))

            seconds = self.__node.get_info('uptime')['seconds']
            lastboot = self.__node.get_info('uptime')['lastboot']

            text = _('%s (%s seconds).') % (lastboot, seconds)

            self.__uptime_value = BWLabel(text)
            self.__uptime_value.set_selectable(True)
            self.__uptime_value.set_line_wrap(False)

            self.__general.bw_attach_next(self.__uptime_label,
                                          yoptions=gtk.FILL,
                                          xoptions=gtk.FILL)
            self.__general.bw_attach_next(self.__uptime_value,
                                          yoptions=gtk.FILL)

        self.__general_frame.bw_add(self.__general)
        self.__general_frame.set_expanded(True)

        sequences = self.__node.get_info('sequences')
        if len(sequences) > 0:
            self.__sequences_frame.bw_add(
                    self.__create_sequences_widget(sequences))

        # operating system information widgets
        self.__os = gtk.Notebook()
#.........這裏部分代碼省略.........
開發者ID:mogigoma,項目名稱:nmap,代碼行數:101,代碼來源:NodeNotebook.py

示例4: __create_widgets

    def __create_widgets(self):
        """
        """
        self.__vbox = BWVBox()
        self.__vbox.set_border_width(6)

        self.__cell = gtk.CellRendererText()

        self.__general_frame = BWExpander(_("General information"))
        self.__sequences_frame = BWExpander(_("Sequences"))
        self.__os_frame = BWExpander(_("Operating System"))

        self.__sequences_frame.bw_add(gtk.Label(_("No sequence information.")))
        self.__os_frame.bw_add(gtk.Label(_("No OS information.")))

        # general information widgets
        self.__general = BWTable(3, 2)

        self.__address_label = BWSectionLabel(_("Address:"))
        self.__address_list = gtk.combo_box_entry_new_text()
        self.__address_list.child.set_editable(False)

        for address in self.__node.get_info("addresses"):

            params = address["type"], address["addr"]
            address_text = SYSTEM_ADDRESS_TEXT % params

            if address["vendor"] is not None and address["vendor"] != "":
                address_text += " (%s)" % address["vendor"]

            self.__address_list.append_text(address_text)

        self.__address_list.set_active(0)

        self.__general.bw_attach_next(self.__address_label, yoptions=gtk.FILL, xoptions=gtk.FILL)
        self.__general.bw_attach_next(self.__address_list, yoptions=gtk.FILL)

        if self.__node.get_info("hostnames") is not None:

            self.__hostname_label = BWSectionLabel(_("Hostname:"))
            self.__hostname_list = gtk.combo_box_entry_new_text()
            self.__hostname_list.child.set_editable(False)

            for hostname in self.__node.get_info("hostnames"):

                params = hostname["type"], hostname["name"]
                self.__hostname_list.append_text(SYSTEM_ADDRESS_TEXT % params)

            self.__hostname_list.set_active(0)

            self.__general.bw_attach_next(self.__hostname_label, yoptions=gtk.FILL, xoptions=gtk.FILL)
            self.__general.bw_attach_next(self.__hostname_list, yoptions=gtk.FILL)

        if self.__node.get_info("uptime") is not None:

            self.__uptime_label = BWSectionLabel(_("Last boot:"))

            seconds = self.__node.get_info("uptime")["seconds"]
            lastboot = self.__node.get_info("uptime")["lastboot"]

            text = _("%s (%s seconds).") % (lastboot, seconds)

            self.__uptime_value = BWLabel(text)
            self.__uptime_value.set_selectable(True)
            self.__uptime_value.set_line_wrap(False)

            self.__general.bw_attach_next(self.__uptime_label, yoptions=gtk.FILL, xoptions=gtk.FILL)
            self.__general.bw_attach_next(self.__uptime_value, yoptions=gtk.FILL)

        self.__general_frame.bw_add(self.__general)
        self.__general_frame.set_expanded(True)

        sequences = self.__node.get_info("sequences")
        if len(sequences) > 0:
            self.__sequences_frame.bw_add(self.__create_sequences_widget(sequences))

        # operating system information widgets
        self.__os = gtk.Notebook()

        os = self.__node.get_info("os")

        if os is not None:

            if "matches" in os:

                self.__match_scroll = BWScrolledWindow()

                self.__match_store = gtk.ListStore(
                    gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_INT, gobject.TYPE_BOOLEAN
                )

                self.__match_treeview = gtk.TreeView(self.__match_store)

                for os_match in os["matches"]:

                    self.__match_store.append(
                        [
                            os_match["accuracy"],
                            os_match["name"],
                            # os_match['db_line'],
#.........這裏部分代碼省略.........
開發者ID:VonNaturAustreVe,項目名稱:nmap,代碼行數:101,代碼來源:NodeNotebook.py

示例5: SystemPage

class SystemPage(BWScrolledWindow):
    """
    """

    def __init__(self, node):
        """
        """
        BWScrolledWindow.__init__(self)

        self.__node = node
        self.__font = pango.FontDescription("Monospace")

        self.__create_widgets()

    def __create_widgets(self):
        """
        """
        self.__vbox = BWVBox()
        self.__vbox.set_border_width(6)

        self.__cell = gtk.CellRendererText()

        self.__general_frame = BWExpander(_("General information"))
        self.__sequences_frame = BWExpander(_("Sequences"))
        self.__os_frame = BWExpander(_("Operating System"))

        self.__sequences_frame.bw_add(gtk.Label(_("No sequence information.")))
        self.__os_frame.bw_add(gtk.Label(_("No OS information.")))

        # general information widgets
        self.__general = BWTable(3, 2)

        self.__address_label = BWSectionLabel(_("Address:"))
        self.__address_list = gtk.combo_box_entry_new_text()
        self.__address_list.child.set_editable(False)

        for address in self.__node.get_info("addresses"):

            params = address["type"], address["addr"]
            address_text = SYSTEM_ADDRESS_TEXT % params

            if address["vendor"] is not None and address["vendor"] != "":
                address_text += " (%s)" % address["vendor"]

            self.__address_list.append_text(address_text)

        self.__address_list.set_active(0)

        self.__general.bw_attach_next(self.__address_label, yoptions=gtk.FILL, xoptions=gtk.FILL)
        self.__general.bw_attach_next(self.__address_list, yoptions=gtk.FILL)

        if self.__node.get_info("hostnames") is not None:

            self.__hostname_label = BWSectionLabel(_("Hostname:"))
            self.__hostname_list = gtk.combo_box_entry_new_text()
            self.__hostname_list.child.set_editable(False)

            for hostname in self.__node.get_info("hostnames"):

                params = hostname["type"], hostname["name"]
                self.__hostname_list.append_text(SYSTEM_ADDRESS_TEXT % params)

            self.__hostname_list.set_active(0)

            self.__general.bw_attach_next(self.__hostname_label, yoptions=gtk.FILL, xoptions=gtk.FILL)
            self.__general.bw_attach_next(self.__hostname_list, yoptions=gtk.FILL)

        if self.__node.get_info("uptime") is not None:

            self.__uptime_label = BWSectionLabel(_("Last boot:"))

            seconds = self.__node.get_info("uptime")["seconds"]
            lastboot = self.__node.get_info("uptime")["lastboot"]

            text = _("%s (%s seconds).") % (lastboot, seconds)

            self.__uptime_value = BWLabel(text)
            self.__uptime_value.set_selectable(True)
            self.__uptime_value.set_line_wrap(False)

            self.__general.bw_attach_next(self.__uptime_label, yoptions=gtk.FILL, xoptions=gtk.FILL)
            self.__general.bw_attach_next(self.__uptime_value, yoptions=gtk.FILL)

        self.__general_frame.bw_add(self.__general)
        self.__general_frame.set_expanded(True)

        sequences = self.__node.get_info("sequences")
        if len(sequences) > 0:
            self.__sequences_frame.bw_add(self.__create_sequences_widget(sequences))

        # operating system information widgets
        self.__os = gtk.Notebook()

        os = self.__node.get_info("os")

        if os is not None:

            if "matches" in os:

                self.__match_scroll = BWScrolledWindow()
#.........這裏部分代碼省略.........
開發者ID:VonNaturAustreVe,項目名稱:nmap,代碼行數:101,代碼來源:NodeNotebook.py


注:本文中的radialnet.bestwidgets.expanders.BWExpander類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。