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


Python Menu.add方法代码示例

本文整理汇总了Python中menu.Menu.add方法的典型用法代码示例。如果您正苦于以下问题:Python Menu.add方法的具体用法?Python Menu.add怎么用?Python Menu.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在menu.Menu的用法示例。


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

示例1: build_shows_menu

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import add [as 别名]
 def build_shows_menu(self, shows):         
     menu = Menu(self.base_url, self.addon_handle)
     for show in shows:
         iconImage = show.img if len(show.img) > 0 else 'DefaultVideo.png'
         li = MenuItem(show.title, 'episodes', args={'code': show.code}, iconImage=iconImage)
         menu.add(li)
     menu.show() 
开发者ID:samsaga2,项目名称:tv3alacarta,代码行数:9,代码来源:tv3channel.py

示例2: mode__episodes

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import add [as 别名]
 def mode__episodes(self):
     id = self.args['id'][0]
     menu = Menu(self.base_url, self.addon_handle)
     for item in a3media.get_episodes(id):
         video = {"Plot": item['plot']}
         menu.add(MenuItem(item['title'], 'play', args={'id': id}, iconImage=item['img'], video=video))
     menu.show()
开发者ID:samsaga2,项目名称:tv3alacarta,代码行数:9,代码来源:a3mediachannel.py

示例3: mode__section

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import add [as 别名]
 def mode__section(self):
     id = self.args['id'][0]
     menu = Menu(self.base_url, self.addon_handle)
     for item in a3media.get_section(id):
         video = {"Plot": item['plot']}
         menu.add(MenuItem(item['title'], 'subcategories', args={'id': id, 'subid': item['id']}, iconImage=item['img'], video=video))
     menu.show()
开发者ID:samsaga2,项目名称:tv3alacarta,代码行数:9,代码来源:a3mediachannel.py

示例4: mainmenu

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import add [as 别名]
 def mainmenu(self):
     menu = Menu(self.base_url, self.addon_handle)
     menu.add(MenuItem('Programes', 'programes', iconImage='DefaultFolder.png'))
     menu.add(MenuItem('Directe', 'directe', iconImage='DefaultFolder.png'))
     menu.add(MenuItem('Buscar', 'buscar', iconImage='DefaultFolder.png'))
     menu.add(MenuItem('Mes destacats', 'mesdestacats', iconImage='DefaultFolder.png'))
     menu.add(MenuItem('Mes vistos', 'mesvistos', iconImage='DefaultFolder.png'))
     menu.add(MenuItem('Mes votats', 'mesvotats', iconImage='DefaultFolder.png'))
     menu.show()
开发者ID:samsaga2,项目名称:tv3alacarta,代码行数:11,代码来源:tv3channel.py

示例5: build_episodes_menu

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import add [as 别名]
 def build_episodes_menu(self, episodes, include_subtitle=False):
     menu = Menu(self.base_url, self.addon_handle)
     for item in episodes:
         if include_subtitle and len(item.subtitle) != 0:
             title = '{0} - {1}'.format(item.title, item.subtitle)
         else:
             title = item.title
         video = {"Title": title, "Plot": item.plot, "Date": item.date}
         li = MenuItem(title, 'play', args={'code': item.code}, iconImage='DefaultVideo.png', video=video)
         menu.add(li)
     menu.show()
开发者ID:samsaga2,项目名称:tv3alacarta,代码行数:13,代码来源:tv3channel.py

示例6: PauseState

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import add [as 别名]
class PauseState(AppState):
    def setup(self):
        AppState.setup(self)

        self.menu = Menu()
        self.menu.add("Resume", None)
        self.menu.add("Restart", None)
        self.menu.add("Main Menu", None)
        self.menu.add("Exit", None)
        self.menu.build()

        # save app state
        self.game = self.app.state

        # render the screen background
        self.background = pygame.display.get_surface().convert()
        overlay = pygame.Surface(self.background.get_size())
        overlay.set_alpha(200)
        overlay.fill((0, 0, 0))

        self.background.blit(overlay, (0, 0))

    def resume(self):
        pygame.mixer.music.pause()

    def resume_game(self):
        pygame.mixer.music.unpause()
        self.app.set_state(self.game)

    def handle_event(self, event):
        if event.type == KEYDOWN and event.key == K_ESCAPE:
            self.resume_game()

    def draw(self):
        self.screen.blit(self.background, (0, 0))
        self.menu.draw(self.screen)
        pygame.display.flip()
开发者ID:HampshireCS,项目名称:cs143-Spring2012,代码行数:39,代码来源:menustates.py

示例7: Menu

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import add [as 别名]
from menu import MenuItem, Menu
from waitress import Waitress


pancake_house_menu = Menu('PANCAKE HOUSE MENU', 'Breakfast')
diner_menu = Menu('DINER MENU', 'Lunch')
cafe_menu = Menu('CAFE MENU', 'Dinner')
dessert_menu = Menu('DESSERT MENU', 'Dessert')

pancake_house_menu.add(MenuItem("K&B's Pancake Breakfast",
                                "Pancakes with scrambled eggs, and toast",
                                True,
                                2.99))
pancake_house_menu.add(MenuItem("Regular Pancake Breakfast",
                                "Pancakes with fried eggs, sausage",
                                False,
                                2.99))
pancake_house_menu.add(MenuItem("Blueberry Pancakes",
                                "Pancakes made with fresh blueberries",
                                True,
                                3.49))
pancake_house_menu.add(MenuItem("Waffles",
                                "Waffles, with your choice of blueberries" +
                                "or strawberries",
                                True,
                                3.59))

diner_menu.add(MenuItem("Vegetarian BLT",
                        "(Fakin') Bacon with lettuce & tomato on" +
                        "whole wheat",
                        True,
开发者ID:lk9025,项目名称:PyPattern,代码行数:33,代码来源:test.py

示例8: mode__directe

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import add [as 别名]
 def mode__directe(self):
     menu = Menu(self.base_url, self.addon_handle)
     menu.add(MenuItem('TV3', 'arafem', args={'canal': 'TV3'}, iconImage='DefaultVideo.png'))
     menu.add(MenuItem('TV3 CAT', 'arafem', args={'canal': 'TV3CAT'}, iconImage='DefaultVideo.png'))
     menu.add(MenuItem('C33', 'arafem', args={'canal': '33'}, iconImage='DefaultVideo.png'))
     menu.add(MenuItem('3/24', 'arafem', args={'canal': '324'}, iconImage='DefaultVideo.png'))
     menu.add(MenuItem('Super 3', 'arafem', args={'canal': 'SUPER3'}, iconImage='DefaultVideo.png'))
     menu.add(MenuItem('Cameres TV3', 'arafem', args={'canal': 'cameres'}, iconImage='DefaultVideo.png'))
     menu.show()
开发者ID:samsaga2,项目名称:tv3alacarta,代码行数:11,代码来源:tv3channel.py

示例9: mode__programes

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import add [as 别名]
 def mode__programes(self):
     menu = Menu(self.base_url, self.addon_handle)
     for letter in tv3.letters:
         li = MenuItem(letter, 'letter', args={'letter': letter}, iconImage='DefaultFolder.png')
         menu.add(li)
     menu.show() 
开发者ID:samsaga2,项目名称:tv3alacarta,代码行数:8,代码来源:tv3channel.py

示例10: make_menu

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import add [as 别名]
    def make_menu(self):
        import cipher

        self.cipher_module = cipher
        self.load_plugins_info()
        menu = Menu(
            "Configure sshproxy",
            None,
            MenuSep("Global options"),
            MenuInput(
                "IP address or interface",
                (
                    "Enter the IP address or the interface name on wich "
                    "the server will listen for incoming connections."
                ),
                self.cfg["listen_on"] or "any",
                self.set_listen_on,
            ),
            MenuInput(
                "Port",
                ("Enter the port on which the server will listen for " "incoming connections."),
                self.cfg["port"],
                self.set_port,
            ),
            MenuInput(
                "Auto-add public key",
                (
                    "If you want the auto-add-key feature, enter here the "
                    "number of keys auto-added in the client keyring, or "
                    "'yes' for no limit. Saying 'no' disable this feature."
                    "\nAttention: this feature, if enabled, can be "
                    "dangerous."
                ),
                self.cfg["auto_add_key"],
                self.set_auto_add_key,
            ),
            MenuInput(
                "Public key id string",
                (
                    "Enter the public key id string used to identify the "
                    "proxy public key that can be put in a remote "
                    ".ssh/authorized_keys file. This is typically in the "
                    "form of an email address."
                ),
                self.cfg["pkey_id"],
                self.set_pkey_id,
            ),
        )

        menu.add(MenuDyn(self.make_cipher_menu, "Cipher"))

        menu.add(MenuSep())

        menu.add(MenuDyn(self.make_backends_menu, "Backends"))

        menu.add(MenuSep())

        menu.add(self.make_plugins_menu())

        menu.add(MenuSep())

        menu.back_text = "Quit"
        return menu
开发者ID:OutOfOrder,项目名称:sshproxy,代码行数:65,代码来源:wizard.py

示例11: mainmenu

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import add [as 别名]
 def mainmenu(self):
     menu = Menu(self.base_url, self.addon_handle)
     for item in a3media.get_mainmenu():
         menu.add(MenuItem(item['title'], 'section', args={'id': item['id']}, iconImage=item['img']))
     menu.show()
开发者ID:samsaga2,项目名称:tv3alacarta,代码行数:7,代码来源:a3mediachannel.py


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