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

Python uiutil.get_list_selection函数代码示例

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

本文整理汇总了Python中virtManager.uiutil.get_list_selection函数的典型用法代码示例。如果您正苦于以下问题:Python get_list_selection函数的具体用法?Python get_list_selection怎么用?Python get_list_selection使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_list_selection函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: validate_bond

    def validate_bond(self, iobj, ifaces):
        mode = uiutil.get_list_selection(self.widget("bond-mode"), 1)
        mon = uiutil.get_list_selection(self.widget("bond-monitor-mode"), 1)
        arp_val = uiutil.get_list_selection(self.widget("arp-validate"), 0)
        mii_car = uiutil.get_list_selection(self.widget("mii-carrier"), 0)

        # ARP params
        arp_int = self.widget("arp-interval").get_value()
        arp_tar = self.widget("arp-target").get_text()

        # MII params
        mii_freq = self.widget("mii-frequency").get_value()
        mii_up = self.widget("mii-updelay").get_value()
        mii_down = self.widget("mii-downdelay").get_value()

        iobj.bond_mode = mode

        if not mon:
            # No monitor params, just return
            return True

        if mon == "arpmon":
            iobj.arp_validate_mode = arp_val
            iobj.arp_interval = int(arp_int)
            iobj.arp_target = arp_tar or None

        elif mon == "miimon":
            iobj.mii_carrier_mode = mii_car
            iobj.mii_frequency = int(mii_freq)
            iobj.mii_updelay = int(mii_up)
            iobj.mii_downdelay = int(mii_down)

        return True
开发者ID:giuseppe,项目名称:virt-manager,代码行数:33,代码来源:createinterface.py


示例2: get_config_forwarding

    def get_config_forwarding(self):
        if self.widget("net-forward-none").get_active():
            return [None, None]

        name = uiutil.get_list_selection(self.widget("net-forward"), 1)
        mode = uiutil.get_list_selection(self.widget("net-forward-mode"), 1)
        return [name, mode]
开发者ID:giuseppe,项目名称:virt-manager,代码行数:7,代码来源:createnet.py


示例3: update_bond_desc

    def update_bond_desc(self):
        mode = uiutil.get_list_selection(self.widget("bond-mode"), 0)
        mon = uiutil.get_list_selection(self.widget("bond-monitor-mode"), 1)

        txt = mode
        if mon:
            txt += ", %s" % mon

        self.widget("bond-config-label").set_text(txt)
开发者ID:giuseppe,项目名称:virt-manager,代码行数:9,代码来源:createinterface.py


示例4: get_values

    def get_values(self):
        gtype = uiutil.get_list_selection(self.widget("graphics-type"), 0)
        port, tlsport = self._get_config_graphics_ports()
        addr = uiutil.get_list_selection(self.widget("graphics-address"), 0)
        keymap = uiutil.get_combo_entry(self.widget("graphics-keymap"))
        if keymap == "auto":
            keymap = None

        passwd = self.widget("graphics-password").get_text()
        if not self.widget("graphics-password-chk").get_active():
            passwd = None

        return gtype, port, tlsport, addr, passwd, keymap
开发者ID:giuseppe,项目名称:virt-manager,代码行数:13,代码来源:gfxdetails.py


示例5: get_pool_to_validate

    def get_pool_to_validate(self):
        """
        Return a pool instance to use for parameter assignment validation.
        For most pools this will be the one we built after step 1, but for
        pools we find via FindPoolSources, this will be different
        """
        source_list = self.widget("pool-source-path")
        target_list = self.widget("pool-target-path")

        pool = uiutil.get_list_selection(source_list, 2)
        if pool is None:
            pool = uiutil.get_list_selection(target_list, 2)

        return pool
开发者ID:giuseppe,项目名称:virt-manager,代码行数:14,代码来源:createpool.py


示例6: destconn_changed

    def destconn_changed(self, src):
        row = uiutil.get_list_selection(src, None)
        tooltip = ""
        if row:
            tooltip = _("A valid destination connection must be selected.")

        self.widget("migrate-finish").set_sensitive(bool(row))
        self.widget("migrate-finish").set_tooltip_text(tooltip)
开发者ID:giuseppe,项目名称:virt-manager,代码行数:8,代码来源:migrate.py


示例7: current_pool

 def current_pool(self):
     row = uiutil.get_list_selection(self.widget("pool-list"))
     if not row:
         return
     try:
         return self.conn.get_pool(row[0])
     except KeyError:
         return None
开发者ID:aurex-linux,项目名称:virt-manager,代码行数:8,代码来源:storagebrowse.py


示例8: get_config_source_path

    def get_config_source_path(self):
        src = self.widget("pool-source-path")
        if not src.get_sensitive():
            return None

        ret = uiutil.get_list_selection(src, 1)
        if ret is not None:
            return ret
        return src.get_child().get_text().strip()
开发者ID:giuseppe,项目名称:virt-manager,代码行数:9,代码来源:createpool.py


示例9: current_vol

    def current_vol(self):
        pool = self.current_pool()
        if not pool:
            return None

        key = uiutil.get_list_selection(self.widget("vol-list"), 0)
        try:
            return key and pool.get_volume(key)
        except KeyError:
            return None
开发者ID:giuseppe,项目名称:virt-manager,代码行数:10,代码来源:host.py


示例10: _repopulate_network_list

    def _repopulate_network_list(self, *args, **kwargs):
        ignore = args
        ignore = kwargs

        netlist = self.widget("net-source")
        label = uiutil.get_list_selection(netlist, 2)
        self._populate_network_list()

        for row in netlist.get_model():
            if label and row[2] == label:
                netlist.set_active_iter(row.iter)
                return
开发者ID:aurex-linux,项目名称:virt-manager,代码行数:12,代码来源:netlist.py


示例11: get_network_selection

    def get_network_selection(self):
        net_list = self.widget("net-source")
        bridge_entry = self.widget("net-bridge-name")

        row = uiutil.get_list_selection(net_list)
        if not row:
            return None, None, None

        net_type = row[0]
        net_src = row[1]
        net_check_bridge = row[5]

        if net_check_bridge and bridge_entry:
            net_type = virtinst.VirtualNetworkInterface.TYPE_BRIDGE
            net_src = bridge_entry.get_text()

        mode = None
        if self.widget("net-source-mode").is_visible():
            mode = uiutil.get_list_selection(self.widget("net-source-mode"), 0)

        return net_type, net_src, mode
开发者ID:aurex-linux,项目名称:virt-manager,代码行数:21,代码来源:netlist.py


示例12: bond_monitor_mode_changed

    def bond_monitor_mode_changed(self, src):
        value = uiutil.get_list_selection(src, 1)
        bond_pages = self.widget("bond-pages")

        if value == "arpmon":
            page = BOND_PAGE_ARP
        elif value == "miimon":
            page = BOND_PAGE_MII
        else:
            page = BOND_PAGE_DEFAULT

        bond_pages.set_current_page(page)
开发者ID:giuseppe,项目名称:virt-manager,代码行数:12,代码来源:createinterface.py


示例13: _get_selected_snapshot

    def _get_selected_snapshot(self):
        name = uiutil.get_list_selection(self.widget("snapshot-list"), 0)
        if not name:
            return None

        try:
            for snap in self.vm.list_snapshots():
                if name == snap.get_name():
                    return snap
        except:
            pass
        return None
开发者ID:giuseppe,项目名称:virt-manager,代码行数:12,代码来源:snapshots.py


示例14: _get_config_graphics_ports

    def _get_config_graphics_ports(self):
        port = uiutil.spin_get_helper(self.widget("graphics-port"))
        tlsport = uiutil.spin_get_helper(self.widget("graphics-tlsport"))
        gtype = uiutil.get_list_selection(self.widget("graphics-type"), 0)

        if self.widget("graphics-port-auto").get_active():
            port = -1
        if self.widget("graphics-tlsport-auto").get_active():
            tlsport = -1

        if gtype != "spice":
            tlsport = None
        return port, tlsport
开发者ID:giuseppe,项目名称:virt-manager,代码行数:13,代码来源:gfxdetails.py


示例15: interface_apply

    def interface_apply(self, src_ignore):
        interface = self.current_interface()
        if interface is None:
            return

        newmode = uiutil.get_list_selection(
            self.widget("interface-startmode"), 0)

        logging.debug("Applying changes for interface '%s'",
                      interface.get_name())
        try:
            interface.set_startmode(newmode)
        except Exception, e:
            self.err.show_err(_("Error setting interface startmode: %s") %
                              str(e))
            return
开发者ID:giuseppe,项目名称:virt-manager,代码行数:16,代码来源:host.py


示例16: _on_net_source_changed

    def _on_net_source_changed(self, src):
        self._emit_changed()

        row = uiutil.get_list_selection(src)
        if not row:
            return

        is_direct = (row[0] == virtinst.VirtualNetworkInterface.TYPE_DIRECT)

        self.widget("vport-expander").set_visible(is_direct)
        uiutil.set_grid_row_visible(self.widget("net-source-mode"), is_direct)
        uiutil.set_grid_row_visible(
            self.widget("net-macvtap-warn-box"), is_direct)
        if is_direct and self.widget("net-source-mode").get_active() == -1:
            self.widget("net-source-mode").set_active(0)

        show_bridge = row[5]
        uiutil.set_grid_row_visible(
            self.widget("net-bridge-name"), show_bridge)
开发者ID:aurex-linux,项目名称:virt-manager,代码行数:19,代码来源:netlist.py


示例17: _show_rows_from_type

    def _show_rows_from_type(self):
        hide_all = ["graphics-xauth", "graphics-display", "graphics-address",
            "graphics-password-box", "graphics-keymap", "graphics-port-box",
            "graphics-tlsport-box"]

        gtype = uiutil.get_list_selection(self.widget("graphics-type"), 0)
        sdl_rows = ["graphics-xauth", "graphics-display"]
        vnc_rows = ["graphics-password-box", "graphics-address",
            "graphics-port-box", "graphics-keymap"]
        spice_rows = vnc_rows[:] + ["graphics-tlsport-box"]

        rows = []
        if gtype == "sdl":
            rows = sdl_rows
        elif gtype == "vnc":
            rows = vnc_rows
        elif gtype == "spice":
            rows = spice_rows

        for row in hide_all:
            uiutil.set_grid_row_visible(self.widget(row), row in rows)
开发者ID:giuseppe,项目名称:virt-manager,代码行数:21,代码来源:gfxdetails.py


示例18: change_add_spice_usbredir

 def change_add_spice_usbredir(self, src):
     self.config.set_add_spice_usbredir(uiutil.get_list_selection(src, 0))
开发者ID:giuseppe,项目名称:virt-manager,代码行数:2,代码来源:preferences.py


示例19: get_config_type

 def get_config_type(self):
     return uiutil.get_list_selection(self.widget("pool-type"), 0)
开发者ID:giuseppe,项目名称:virt-manager,代码行数:2,代码来源:createpool.py


示例20: get_config_fs_format

 def get_config_fs_format(self):
     return uiutil.get_list_selection(self.widget("fs-format-combo"),
                                      rowindex=0, check_visible=True)
开发者ID:aurex-linux,项目名称:virt-manager,代码行数:3,代码来源:fsdetails.py



注:本文中的virtManager.uiutil.get_list_selection函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python virt_utils.generate_random_string函数代码示例发布时间:2022-05-26
下一篇:
Python vmmGObjectUI.__init__函数代码示例发布时间: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