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


Python Menu.show方法代码示例

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


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

示例1: mode__episodes

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import show [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

示例2: mode__section

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import show [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

示例3: build_shows_menu

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import show [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

示例4: mode__directe

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import show [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

示例5: mainmenu

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import show [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

示例6: build_episodes_menu

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import show [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

示例7: main

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import show [as 别名]
def main():
    ser = serial.Serial('/dev/ttyAMA0', 7600, timeout=0)

    menu = Menu(MENU_STRUCTURE, 20, 4, output='lcd')
    menu.show()

    while True:
        data = ser.read(8).strip()

        if data:
            if data == 'c':     # clockwise
                menu.down()
            elif data == 'a':   # anti-clockwise
                menu.up()
            elif data == 'p':   # press
                menu.select()
            menu.show()
        sleep(0.01)
开发者ID:damianmoore,项目名称:hub-ui,代码行数:20,代码来源:service.py

示例8: select_card

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import show [as 别名]
def select_card(only_valid=False):
    m = Menu()
    m.query = "Please Select your Micro SD card"
    m.items = []
    cards = detect_cards()
    if CommandLine.peek_next():
        device = CommandLine.get_next()
        return filter(lambda card: card.device == device, cards)[0]
    for card in cards:
        if not only_valid or card.is_created():
            m.items.append(MenuItem(card.device, card))
    return m.show()
开发者ID:squirly,项目名称:gumtools,代码行数:14,代码来源:sdcard.py

示例9: generateMenu

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import show [as 别名]
def generateMenu(properties):
    """Generates the menu for a given page"""
    #Checks for menu presence
    print "Menu Generated"
    try:
        properties["menu"]
    except KeyError:
        print "No menu"
        return ""

    menu = Menu()
    for item in properties["menu"]:
        menu.addItem(MenuItem(properties["menu"][item]))
        
    menu.sortItems()
    return menu.show()
开发者ID:stealthycoin,项目名称:kaleidoscope,代码行数:18,代码来源:pagesConfig.py

示例10: generateRandColor

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import show [as 别名]
#menu.show('main')

def generateRandColor():
	"""
    This function generates random RGB triplets.
    """
	return (randint(0,255), randint(0,255), randint(0,255))

exit = False
restart = True

while restart:

	exit = menu.exitOrNot()
	if not exit:
		menu.show('main')
	else:
		restart = False
	exit = menu.exitOrNot()

	if not exit:

		# imports ogg sound file
		pygame.mixer.music.load(os.path.join('audio','epica.v1.wav'))

		# initialize the display
		pygame.display.init()
		# get information about the display
		# we only really care about the size of the display
		displayInfo = pygame.display.Info()
		# put the width and height of the user's screen in variables
开发者ID:jcpeterson,项目名称:avoidr,代码行数:33,代码来源:avoidr.py

示例11: mainmenu

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import show [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

示例12: Menu

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import show [as 别名]
screen = pygame.display.set_mode((1024, 600))
pygame.display.set_caption('Pytletismo')
clock = pygame.time.Clock()
mousepos = (0, 0)
LEFT = 1

#p1=Player([pygame.image.load("j2a.bmp"),pygame.image.load("j2b.bmp")],0,13,0)
#p2=Player([pygame.image.load("j1a.bmp"),pygame.image.load("j1b.bmp")],40,350,0)
p1imahora = 1
#fondo = pygame.image.load("estadio.bmp")

#Menu
#menu = Menu(['100m lisos','110m vallas', 'Salto de longitud', None, u'Créditos', 'Salir'])
menu = Menu(['100m lisos', 'Salto de longitud', None, u'Créditos', 'Salir'])
while True:
    game = menu.show(screen, clock)

    if game == 'Salir':
        #print 'Salir'
        sys.exit(0)
    elif game == u'Créditos':
        #print 'Créditos'
        play = Credits()
        play.play(screen, clock)
    elif game == '100m lisos':
        #print '100m lisos'
        play = Game100m()
        play.play(screen, clock)
    elif game == '110m vallas':
        #print '110m vallas'
        play = Game110mhurdles()
开发者ID:rafael1193,项目名称:pytletismo,代码行数:33,代码来源:pytletismo.py

示例13: read_terminal_arguments

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import show [as 别名]

if __name__ == "__main__":
    read_terminal_arguments()
    set_logger()

    exitProgram = False
    # run configuration management
    config = Configuration()
    manifest = CustomManifest(
        gv.MANIFEST_FILE, gv.MANIFEST_HEADERS, gv.MANIFEST_SEPARATOR)
    menu = Menu(gv.MENU_TITLE)

    options = get_options_list(config, manifest)
    menu.add_options(*options)
    menu.show()
    while not exitProgram:
        try:
            menu.select_option()
        except ExitError as e:
            logging.info(e.message)
            exitProgram = True
        except ConfigurationError as e:
            print(e.message)
            config = Configuration()
            manifest = CustomManifest(
                gv.MANIFEST_FILE, gv.MANIFEST_HEADERS, GDCManifest.separator)
            menu.reset_options()
            options = get_options_list(config, manifest)
            menu.add_options(*options)
            print("")
开发者ID:polito-eda-students,项目名称:tcga-manager,代码行数:32,代码来源:gdcmanager.py

示例14: MACEntry

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import show [as 别名]

#.........这里部分代码省略.........

        self.draw_area.connect("button-press-event", self.button_press_mac_entry)
        self.draw_area.connect("key-press-event", self.key_press_mac_entry)
        self.draw_area.connect("expose-event", self.expose_mac_entry)
        self.draw_area.connect("focus-in-event", self.focus_in_mac_entry)
        self.draw_area.connect("focus-out-event", self.focus_out_mac_entry)
        self.connect("editing", self.__edit_going)

        self.keymap = {
            "Left" : self.move_to_left,
            "Right" : self.move_to_right,
            "Home" : self.move_to_start,
            "End" : self.move_to_end,
            "Ctrl + a" : self.select_current_segment,
            "Ctrl + c" : self.copy_to_clipboard,
            "Ctrl + x" : self.cut_to_clipboard,
            "Ctrl + v" : self.paste_from_clipboard,
            "BackSpace" : self.backspace,
            "Space" : self.insert_mac_dot,
            ":" : self.insert_mac_dot,
            }

        self.right_menu = Menu(
            [(None, _("Cut"), self.cut_to_clipboard),
             (None, _("Copy"), self.copy_to_clipboard),
             (None, _("Paste"), self.paste_from_clipboard),
             ],
            True)

        self.calculate_cursor_positions()

    def set_frame_alert(self, state):
        '''
        Make frame show alert color.

        @param state: Show alert color if state is True, otherwise show normal color.
        '''
        if state:
            self.frame_color = self.alert_frame
        else:
            self.frame_color = self.normal_frame

        self.queue_draw()

    def move_to_left(self):
        '''
        Move cursor backward.
        '''
        if self.cursor_index > 0:
            self.set_cursor_index(self.cursor_index - 1)
            self.clear_highlight_segment()
            self.queue_draw()

    def move_to_right(self):
        '''
        Move cursor forward.
        '''
        if self.cursor_index < len(self.mac):
            self.set_cursor_index(self.cursor_index + 1)
            self.clear_highlight_segment()
            self.queue_draw()

    def move_to_start(self):
        '''
        Move cursor to start position.
        '''
开发者ID:chenzhiwei,项目名称:deepin-ui,代码行数:70,代码来源:net.py

示例15: Main

# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import show [as 别名]

#.........这里部分代码省略.........

    def postInit(self):
        #
        # initialize game content
        #
        base.cTrav = CollisionTraverser("base collision traverser")
        base.pusher = CollisionHandlerPusher()
        self.menu = Menu()
        self.credits = Credits()
        self.charSelection = CharacterSelection()
        self.levelSelection = LevelSelection()
        self.koScreen = KoScreen()
        self.hud = Hud()
        self.menuMusic = loader.loadMusic("assets/audio/menuMusic.ogg")
        self.menuMusic.setLoop(True)
        self.fightMusic = loader.loadMusic("assets/audio/fightMusic.ogg")
        self.fightMusic.setLoop(True)
        base.audio3d = Audio3DManager(base.sfxManagerList[0], camera)

        #
        # Event handling
        #
        self.accept("escape", self.__escape)

        #
        # Start with the menu
        #
        self.request("Menu")

    #
    # FSM PART
    #
    def enterMenu(self):
        show_cursor()
        self.accept("Menu-Start", self.request, ["CharSelection"])
        self.accept("Menu-Credits", self.request, ["Credits"])
        self.accept("Menu-Quit", self.quit)
        self.ignore("KoScreen-Back")
        self.koScreen.hide()
        self.menu.show()
        if self.menuMusic.status() != AudioSound.PLAYING:
            self.menuMusic.play()
        if self.fightMusic.status() == AudioSound.PLAYING:
            self.fightMusic.stop()

    def exitMenu(self):
        self.ignore("Menu-Start")
        self.ignore("Menu-Credits")
        self.ignore("Menu-Quit")
        self.menu.hide()

    def enterCredits(self):
        self.accept("Credits-Back", self.request, ["Menu"])
        self.koScreen.hide()
        self.credits.show()

    def exitCredits(self):
        self.ignore("Credits-Back")
        self.credits.hide()

    def enterCharSelection(self):
        self.accept("CharSelection-Back", self.request, ["Menu"])
        self.accept("CharSelection-Start", self.request, ["LevelSelection"])
        self.charSelection.show()

    def exitCharSelection(self):
开发者ID:jorjuato,项目名称:panda3d-tutorial,代码行数:70,代码来源:main.py


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