当前位置: 首页>>代码示例>>Python>>正文


Python menu.display函数代码示例

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


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

示例1: display

    def display(self):
        items = [
            pvc.widget.menu.MenuItem(
                tag='Create',
                description='Create new datastore',
                on_select=self.create_datastore
            ),
            pvc.widget.menu.MenuItem(
                tag='Unmount',
                description='Unmount datastores',
                on_select=HostSystemUnmountStorage,
                on_select_args=(self.agent, self.dialog, self.obj)
            ),
            pvc.widget.menu.MenuItem(
                tag='View',
                description='View datastores',
                on_select=pvc.widget.common.datastore_menu,
                on_select_args=(self.agent, self.dialog, self.obj)
            ),
        ]

        menu = pvc.widget.menu.Menu(
            items=items,
            dialog=self.dialog,
            title=self.title,
            text='Select an action to be performed'
        )

        menu.display()
开发者ID:sigkill,项目名称:pvc,代码行数:29,代码来源:hostsystem.py

示例2: display

    def display(self):
        items = [
            pvc.widget.menu.MenuItem(
                tag='DNS',
                description='Find VMs by DNS name',
                on_select=self.find_by_dns
            ),
            pvc.widget.menu.MenuItem(
                tag='IP',
                description='Find VMs by IP address',
                on_select=self.find_by_ip
            ),
            pvc.widget.menu.MenuItem(
                tag='UUID',
                description='Find VMs by UUID',
                on_select=self.find_by_uuid
            ),
            pvc.widget.menu.MenuItem(
                tag='Datastore Path',
                description='Find VM by its location on a datastore',
                on_select=self.find_by_datastore_path
            ),
        ]

        menu = pvc.widget.menu.Menu(
            items=items,
            dialog=self.dialog,
            title='Inventory Search',
            text='Select criteria for searching of hosts'
        )

        menu.display()
开发者ID:borland667,项目名称:pvc,代码行数:32,代码来源:inventory.py

示例3: display

    def display(self):
        items = [
            pvc.widget.menu.MenuItem(
                tag='Details',
                description='View Alarm Details',
                on_select=self.details
            ),
            pvc.widget.menu.MenuItem(
                tag='Acknowledge',
                description='Acknowledge Alarm',
                on_select=self.acknowledge
            ),
            pvc.widget.menu.MenuItem(
                tag='Reset',
                description='Reset Alarm'
            ),
        ]

        menu = pvc.widget.menu.Menu(
            items=items,
            dialog=self.dialog,
            title=self.title,
            text='Select an action to be performed'
        )

        menu.display()
开发者ID:hartsock,项目名称:pvc,代码行数:26,代码来源:alarm.py

示例4: host_service_menu

def host_service_menu(agent, dialog, obj):
    """
    A widget to display a menu of services in a HostSystem

    Args:
        agent      (VConnector): A VConnector instance
        dialog  (dialog.Dailog): A Dialog instance
        obj    (vim.HostSystem): A HostSystem entity

    """
    title = '{} ({})'.format(obj.name, obj.__class__.__name__)

    dialog.infobox(
        title=title,
        text='Retrieving information ...'
    )

    items = [
        pvc.widget.menu.MenuItem(
            tag=service.key,
            description=service.label,
            on_select=pvc.widget.hostsystem.HostSystemServiceWidget,
            on_select_args=(agent, dialog, obj, service)
        ) for service in obj.config.service.service
    ]

    menu = pvc.widget.menu.Menu(
        items=items,
        dialog=dialog,
        title=title,
        text='Choose a service to manage'
    )

    menu.display()
开发者ID:borland667,项目名称:pvc,代码行数:34,代码来源:common.py

示例5: display

    def display(self):
        items = [
            pvc.widget.menu.MenuItem(
                tag='Info',
                description='Counter information',
                on_select=self.info
            ),
            pvc.widget.menu.MenuItem(
                tag='Graph',
                description='Display graph',
                on_select=PerformanceCounterGraphWidget,
                on_select_args=(self.agent, self.dialog, self.obj, self.counter, self.realtime)
            ),
        ]

        title = 'Performance counter {0}.{1}.{2}'.format(
            self.counter.groupInfo.key,
            self.counter.nameInfo.key,
            self.counter.unitInfo.key
        )

        menu = pvc.widget.menu.Menu(
            items=items,
            dialog=self.dialog,
            title=self.title,
            text=title
        )

        menu.display()
开发者ID:borland667,项目名称:pvc,代码行数:29,代码来源:performance.py

示例6: display

    def display(self):
        items = [
            pvc.widget.menu.MenuItem(
                tag='Rename',
                description='Rename datastore',
                on_select=pvc.widget.common.rename,
                on_select_args=(self.obj, self.dialog)
            ),
            pvc.widget.menu.MenuItem(
                tag='Refresh',
                description='Refresh storage information',
                on_select=self.refresh
            ),
            pvc.widget.menu.MenuItem(
                tag='Remove',
                description='Remove datastore',
                on_select=pvc.widget.common.remove,
                on_select_args=(self.obj, self.dialog)
            ),
        ]

        menu = pvc.widget.menu.Menu(
            items=items,
            dialog=self.dialog,
            title=self.title,
            text='Select an action to be performed'
        )

        menu.display()
开发者ID:hartsock,项目名称:pvc,代码行数:29,代码来源:datastore.py

示例7: display

    def display(self):
        items = [
            pvc.widget.menu.MenuItem(
                tag='Mark Template',
                description='Mark Virtual Machine as template',
                on_select=self.mark_as_template
            ),
            pvc.widget.menu.MenuItem(
                tag='Mark VM',
                description='Mark template as Virtual Machine',
                on_select=self.mark_as_virtual_machine
            ),
            pvc.widget.menu.MenuItem(
                tag='Export OVA',
                description='Export as single file (OVA)',
                on_select=VirtualMachineExportWidget,
                on_select_args=(self.agent, self.dialog, self.obj, True)
            ),
            pvc.widget.menu.MenuItem(
                tag='Export OVF',
                description='Export as directory of files (OVF)',
                on_select=VirtualMachineExportWidget,
                on_select_args=(self.agent, self.dialog, self.obj, False)
            ),
        ]

        menu = pvc.widget.menu.Menu(
            dialog=self.dialog,
            items=items,
            title=self.title,
            text='Select an action to be performed'
        )

        menu.display()
开发者ID:hartsock,项目名称:pvc,代码行数:34,代码来源:virtualmachine.py

示例8: display

    def display(self):
        self.warn_if_not_vcenter()
        self.show_motd()

        items = [
            pvc.widget.menu.MenuItem(
                tag='Inventory',
                description='Inventory Menu',
                on_select=pvc.widget.inventory.InventoryWidget,
                on_select_args=(self.agent, self.dialog)
            ),
            pvc.widget.menu.MenuItem(
                tag='Administration',
                description='Administration Menu',
                on_select=pvc.widget.administration.AdministrationWidget,
                on_select_args=(self.agent, self.dialog)
            ),
        ]

        menu = pvc.widget.menu.Menu(
            items=items,
            dialog=self.dialog,
            title='Home',
            text='Select an item from the menu',
            cancel_label='Logout'
        )

        menu.display()
开发者ID:borland667,项目名称:pvc,代码行数:28,代码来源:home.py

示例9: display

    def display(self):
        items = [
            pvc.widget.menu.MenuItem(
                tag='Connect',
                description='Connect host to cluster',
                on_select=self.connect_host
            ),
            pvc.widget.menu.MenuItem(
                tag='Disconnect',
                description='Disconnect host(s) from cluster',
                on_select=self.disconnect_host
            ),
            pvc.widget.menu.MenuItem(
                tag='Reconnect',
                description='Reconnect host(s) to cluster',
                on_select=self.reconnect_host
            ),
            pvc.widget.menu.MenuItem(
                tag='View',
                description='View hosts in cluster',
                on_select=pvc.widget.common.host_menu,
                on_select_args=(self.agent, self.dialog, self.obj)
            ),
        ]

        menu = pvc.widget.menu.Menu(
            items=items,
            dialog=self.dialog,
            title=self.title,
            text='Select action to be performed'
        )

        menu.display()
开发者ID:borland667,项目名称:pvc,代码行数:33,代码来源:cluster.py

示例10: virtual_machine_menu

    def virtual_machine_menu(self):
        self.dialog.infobox(title=self.title, text="Retrieving information ...")

        view = self.agent.get_container_view(obj_type=[pyVmomi.vim.VirtualMachine], container=self.obj)
        properties = self.agent.collect_properties(
            view_ref=view,
            obj_type=pyVmomi.vim.VirtualMachine,
            path_set=["name", "runtime.powerState"],
            include_mors=True,
        )
        view.DestroyView()

        if not properties:
            self.dialog.msgbox(title=self.title, text="No virtual machines found in datacenter")
            return

        items = [
            pvc.widget.menu.MenuItem(
                tag=vm["name"],
                description=vm["runtime.powerState"],
                on_select=pvc.widget.virtualmachine.VirtualMachineWidget,
                on_select_args=(self.agent, self.dialog, vm["obj"]),
            )
            for vm in properties
        ]

        menu = pvc.widget.menu.Menu(
            items=items, dialog=self.dialog, title=self.title, text="Select a virtual machine from the menu"
        )

        menu.display()
开发者ID:jm66,项目名称:pvc,代码行数:31,代码来源:datacenter.py

示例11: display

    def display(self):
        items = [
            pvc.widget.menu.MenuItem(
                tag='Details',
                description='View Session Details',
                on_select=self.details
            ),
            pvc.widget.menu.MenuItem(
                tag='Terminate',
                description='Terminate Session',
                on_select=self.terminate
            ),
        ]

        current_session = self.agent.si.content.sessionManager.currentSession
        if current_session.key == self.obj.key:
            title = 'Session {}@{} (This Session)'
        else:
            title = 'Session {}@{}'

        menu = pvc.widget.menu.Menu(
            items=items,
            dialog=self.dialog,
            title=title.format(self.obj.userName, self.obj.ipAddress),
            text='Select an action to be performed'
        )

        menu.display()
开发者ID:hartsock,项目名称:pvc,代码行数:28,代码来源:session.py

示例12: display

    def display(self):
        items = [
            pvc.widget.menu.MenuItem(
                tag='Create',
                description='Create new cluster in datacenter',
                on_select=self.create_cluster
            ),
            pvc.widget.menu.MenuItem(
                tag='Remove',
                description='Remove cluster from datacenter'
            ),
            pvc.widget.menu.MenuItem(
                tag='View',
                description='View clusters in datacenter',
                on_select=pvc.widget.common.cluster_menu,
                on_select_args=(self.agent, self.dialog, self.obj)
            ),
        ]

        menu = pvc.widget.menu.Menu(
            items=items,
            dialog=self.dialog,
            title=self.title,
            text='Select an action to be performed'
        )

        menu.display()
开发者ID:hartsock,项目名称:pvc,代码行数:27,代码来源:datacenter.py

示例13: host_menu

    def host_menu(self):
        self.dialog.infobox(title=self.title, text="Retrieving information ...")

        view = self.agent.get_container_view(obj_type=[pyVmomi.vim.HostSystem], container=self.obj)
        properties = self.agent.collect_properties(
            view_ref=view,
            obj_type=pyVmomi.vim.HostSystem,
            path_set=["name", "runtime.connectionState"],
            include_mors=True,
        )
        view.DestroyView()

        if not properties:
            self.dialog.msgbox(title=self.title, text="No hosts found in datacenter")
            return

        items = [
            pvc.widget.menu.MenuItem(
                tag=host["name"],
                description=host["runtime.connectionState"],
                on_select=pvc.widget.hostsystem.HostSystemWidget,
                on_select_args=(self.agent, self.dialog, host["obj"]),
            )
            for host in properties
        ]

        menu = pvc.widget.menu.Menu(
            items=items, dialog=self.dialog, title=self.title, text="Select a host from the menu"
        )

        menu.display()
开发者ID:jm66,项目名称:pvc,代码行数:31,代码来源:datacenter.py

示例14: display

    def display(self):
        items = [
            pvc.widget.menu.MenuItem(
                tag='Details',
                description='View Alarm Details',
                on_select=self.details
            ),
            pvc.widget.menu.MenuItem(
                tag='Acknowledge',
                description='Acknowledge Alarm',
                on_select=self.acknowledge
            ),
            pvc.widget.menu.MenuItem(
                tag='Reset',
                description='Reset Alarm'
            ),
            pvc.widget.menu.MenuItem(
                tag='Debug',
                description='Start a Python REPL console',
                on_select=pvc.widget.debug.DebugWidget,
                on_select_args=(locals(), globals())
            ),
        ]

        menu = pvc.widget.menu.Menu(
            items=items,
            dialog=self.dialog,
            title=self.title,
            text='Select an action to be performed'
        )

        menu.display()
开发者ID:borland667,项目名称:pvc,代码行数:32,代码来源:alarm.py

示例15: network_menu

    def network_menu(self):
        self.dialog.infobox(
            text='Retrieving information ...'
        )

        view = self.agent.get_container_view(
            obj_type=[pyVmomi.vim.Network]
        )

        properties = self.agent.collect_properties(
            view_ref=view,
            obj_type=pyVmomi.vim.Network,
            path_set=['name', 'summary.accessible'],
            include_mors=True
        )
        view.DestroyView()

        items = [
            pvc.widget.menu.MenuItem(
                tag=network['name'],
                description='Accessible' if network['summary.accessible'] else 'Not Accessible',
                on_select=pvc.widget.network.NetworkWidget,
                on_select_args=(self.agent, self.dialog, network['obj'])
            ) for network in properties
        ]

        menu = pvc.widget.menu.Menu(
            items=items,
            dialog=self.dialog,
            title='Networks',
            text='Select a network from the menu that you wish to manage'
        )

        menu.display()
开发者ID:borland667,项目名称:pvc,代码行数:34,代码来源:inventory.py


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