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


Python ui.Subcommand类代码示例

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


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

示例1: commands

    def commands(self):
        lyrics_cmd = Subcommand('lyrics', help='fetch lyrics')
        lyrics_cmd.func = self.lyrics_func
        lyrics_cmd.parser.add_option('-f', '--force', action='store_true', default=None, help='overwrite tag updates')
        lyrics_cmd.parser.add_option('-p', '--processes', dest='processes', help='number of concurrent threads to run')

        return [lyrics_cmd]
开发者ID:Lugoues,项目名称:beets-lyrics,代码行数:7,代码来源:__init__.py

示例2: commands

 def commands(self):
     play_command = Subcommand("play", help="send music to a player as a playlist")
     play_command.parser.add_option(
         "-a", "--album", action="store_true", default=False, help="query and load albums rather than tracks"
     )
     play_command.func = play_music
     return [play_command]
开发者ID:Brainversation,项目名称:beets,代码行数:7,代码来源:play.py

示例3: commands

 def commands(self):
     play_command = Subcommand('play',
         help='send query results to music player as playlist.')
     play_command.parser.add_option('-a', '--album',
         action='store_true', default=False,
         help='query and load albums(folders) rather then tracks.')
     play_command.func = play_music
     return [play_command]
开发者ID:davidhampgonsalves,项目名称:beets-plugin-play,代码行数:8,代码来源:play.py

示例4: commands

 def commands(self):
     play_command = Subcommand(
         'play',
         help='send music to a player as a playlist'
     )
     play_command.parser.add_album_option()
     play_command.func = self.play_music
     return [play_command]
开发者ID:15502119602,项目名称:beets,代码行数:8,代码来源:play.py

示例5: commands

 def commands(self):
     bad_command = Subcommand('bad',
                              help=u'check for corrupt or missing files')
     bad_command.parser.add_option(
         u'-v', u'--verbose',
         action='store_true', default=False, dest='verbose',
         help=u'view results for both the bad and uncorrupted files'
     )
     bad_command.func = self.command
     return [bad_command]
开发者ID:beetbox,项目名称:beets,代码行数:10,代码来源:badfiles.py

示例6: commands

 def commands(self):
     mbupdate = Subcommand('mbupdate',
                           help=u'Update MusicBrainz collection')
     mbupdate.parser.add_option('-r', '--remove',
                                action='store_true',
                                default=None,
                                dest='remove',
                                help='Remove albums not in beets library')
     mbupdate.func = self.update_collection
     return [mbupdate]
开发者ID:bheadwhite,项目名称:beets,代码行数:10,代码来源:mbcollection.py

示例7: commands

 def commands(self):
     play_command = Subcommand(
         'play',
         help='send music to a player as a playlist'
     )
     play_command.parser.add_option(
         '-a', '--album',
         action='store_true', default=False,
         help='query and load albums rather than tracks'
     )
     play_command.func = play_music
     return [play_command]
开发者ID:Dietr1ch,项目名称:beets,代码行数:12,代码来源:play.py

示例8: commands

    def commands(self):
        zero_command = Subcommand('zero', help='set fields to null')

        def zero_fields(lib, opts, args):
            if not decargs(args) and not input_yn(
                    u"Remove fields for all items? (Y/n)",
                    True):
                return
            for item in lib.items(decargs(args)):
                self.process_item(item)

        zero_command.func = zero_fields
        return [zero_command]
开发者ID:JDLH,项目名称:beets,代码行数:13,代码来源:zero.py

示例9: commands

 def commands(self):
     cmds = Subcommand('wlg', help='get genres with whatlastgenre')
     cmds.parser.add_option(
         '-v', '--verbose', dest='verbose', action='count',
         default=0, help='verbose output (-vv for debug)')
     cmds.parser.add_option(
         '-f', '--force', dest='force', action='store_true',
         default=False, help='force overwrite existing genres')
     cmds.parser.add_option(
         '-u', '--update-cache', dest='cache', action='store_true',
         default=False, help='force update cache')
     cmds.func = self.commanded
     return [cmds]
开发者ID:YetAnotherNerd,项目名称:whatlastgenre,代码行数:13,代码来源:wlg.py

示例10: commands

 def commands(self):
     play_command = Subcommand(
         'play',
         help=u'send music to a player as a playlist'
     )
     play_command.parser.add_album_option()
     play_command.parser.add_option(
         u'-A', u'--args',
         action='store',
         help=u'add additional arguments to the command',
     )
     play_command.func = self.play_music
     return [play_command]
开发者ID:agittins,项目名称:beets,代码行数:13,代码来源:play.py

示例11: commands

    def commands(self):
        thumbnails_command = Subcommand("thumbnails",
                                        help="Create album thumbnails")
        thumbnails_command.parser.add_option(
            '-f', '--force', dest='force', action='store_true', default=False,
            help='force regeneration of thumbnails deemed fine (existing & '
                 'recent enough)')
        thumbnails_command.parser.add_option(
            '--dolphin', dest='dolphin', action='store_true', default=False,
            help="create Dolphin-compatible thumbnail information (for KDE)")
        thumbnails_command.func = self.process_query

        return [thumbnails_command]
开发者ID:hiro-sumi1888,项目名称:beets,代码行数:13,代码来源:thumbnails.py

示例12: commands

    def commands(self):
        gupload = Subcommand('gmusic-upload',
                             help=u'upload your tracks to Google Play Music')
        gupload.func = self.upload

        search = Subcommand('gmusic-songs',
                            help=u'list of songs in Google Play Music library')
        search.parser.add_option('-t', '--track', dest='track',
                                 action='store_true',
                                 help='Search by track name')
        search.parser.add_option('-a', '--artist', dest='artist',
                                 action='store_true',
                                 help='Search by artist')
        search.func = self.search
        return [gupload, search]
开发者ID:arogl,项目名称:beets,代码行数:15,代码来源:gmusic.py

示例13: commands

 def commands(self):
     play_command = Subcommand(
         'play',
         help=u'send music to a player as a playlist'
     )
     play_command.parser.add_album_option()
     play_command.parser.add_option(
         u'-A', u'--args',
         action='store',
         help=u'add additional arguments to the command',
     )
     play_command.parser.add_option(
         u'-y', u'--yes',
         action="store_true",
         help=u'skip the warning threshold',
     )
     play_command.func = self._play_command
     return [play_command]
开发者ID:arogl,项目名称:beets,代码行数:18,代码来源:play.py

示例14: commands

    def commands(self):
        thumbnails_command = Subcommand("thumbnails", help=u"Create album thumbnails")
        thumbnails_command.parser.add_option(
            u"-f",
            u"--force",
            dest="force",
            action="store_true",
            default=False,
            help=u"force regeneration of thumbnails deemed fine (existing & " u"recent enough)",
        )
        thumbnails_command.parser.add_option(
            u"--dolphin",
            dest="dolphin",
            action="store_true",
            default=False,
            help=u"create Dolphin-compatible thumbnail information (for KDE)",
        )
        thumbnails_command.func = self.process_query

        return [thumbnails_command]
开发者ID:angelsanz,项目名称:beets,代码行数:20,代码来源:thumbnails.py

示例15: reverse_dict

genres = {}

def reverse_dict(orig):
	reverse = {}
	for (genre, artists) in orig.items():
		for artist in artists:
			reverse[artist]=genre
	return reverse

def get_genre(artist, genre_dict):
	try:
		return genre_dict[artist]
	except KeyError:
		return None
		
update_cmd = Subcommand('update-genres', help='Update the genres of all media in library acording to the current genre list file')
def update_genres(lib, config, opts, args):
	global genres
	global fallback_str
	for item in lib.items(ui.decargs(args)):
		if item.album_id is not None:
			continue
		genre = get_genre(item.artist, genres)
		log.warn("title: %s, artist: %s, genre: %s" % (item.title, item.artist, genre))
		if not genre and fallback_str != None:
			genre = fallback_str
			log.warn(u'no genre for %s in list: fallback to %s' % (item.artist, genre))
		if genre is not None:
			log.warn(u'adding genre for %s from list: %s' % (item.artist, genre))
		item.genre = genre
		lib.store(item)
开发者ID:michl,项目名称:beets,代码行数:31,代码来源:genrelist.py


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