• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python expanders.BWExpander类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python Coordinate.PolarCoordinate类代码示例发布时间:2022-05-26
下一篇:
Python directives.setup函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap