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


Python Subcommand.func方法代码示例

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


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

示例1: commands

# 需要导入模块: from beets.ui import Subcommand [as 别名]
# 或者: from beets.ui.Subcommand import func [as 别名]
    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,代码行数:17,代码来源:gmusic.py

示例2: commands

# 需要导入模块: from beets.ui import Subcommand [as 别名]
# 或者: from beets.ui.Subcommand import func [as 别名]
    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,代码行数:9,代码来源:__init__.py

示例3: commands

# 需要导入模块: from beets.ui import Subcommand [as 别名]
# 或者: from beets.ui.Subcommand import func [as 别名]
 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,代码行数:9,代码来源:play.py

示例4: commands

# 需要导入模块: from beets.ui import Subcommand [as 别名]
# 或者: from beets.ui.Subcommand import func [as 别名]
 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,代码行数:10,代码来源:play.py

示例5: commands

# 需要导入模块: from beets.ui import Subcommand [as 别名]
# 或者: from beets.ui.Subcommand import func [as 别名]
 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,代码行数:10,代码来源:play.py

示例6: commands

# 需要导入模块: from beets.ui import Subcommand [as 别名]
# 或者: from beets.ui.Subcommand import func [as 别名]
 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,代码行数:12,代码来源:mbcollection.py

示例7: commands

# 需要导入模块: from beets.ui import Subcommand [as 别名]
# 或者: from beets.ui.Subcommand import func [as 别名]
 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,代码行数:12,代码来源:badfiles.py

示例8: commands

# 需要导入模块: from beets.ui import Subcommand [as 别名]
# 或者: from beets.ui.Subcommand import func [as 别名]
 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,代码行数:14,代码来源:play.py

示例9: commands

# 需要导入模块: from beets.ui import Subcommand [as 别名]
# 或者: from beets.ui.Subcommand import func [as 别名]
    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,代码行数:15,代码来源:zero.py

示例10: commands

# 需要导入模块: from beets.ui import Subcommand [as 别名]
# 或者: from beets.ui.Subcommand import func [as 别名]
 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,代码行数:15,代码来源:wlg.py

示例11: commands

# 需要导入模块: from beets.ui import Subcommand [as 别名]
# 或者: from beets.ui.Subcommand import func [as 别名]
 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,代码行数:15,代码来源:play.py

示例12: commands

# 需要导入模块: from beets.ui import Subcommand [as 别名]
# 或者: from beets.ui.Subcommand import func [as 别名]
    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,代码行数:15,代码来源:thumbnails.py

示例13: commands

# 需要导入模块: from beets.ui import Subcommand [as 别名]
# 或者: from beets.ui.Subcommand import func [as 别名]
 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,代码行数:20,代码来源:play.py

示例14: commands

# 需要导入模块: from beets.ui import Subcommand [as 别名]
# 或者: from beets.ui.Subcommand import func [as 别名]
    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,代码行数:22,代码来源:thumbnails.py

示例15: get_genre

# 需要导入模块: from beets.ui import Subcommand [as 别名]
# 或者: from beets.ui.Subcommand import func [as 别名]
		item.genre = genre
		lib.store(item)
		item.write()

	for album in lib.albums():
		genre = get_genre(album.albumartist, genres)
		if (genre is None) and (fallback_str is not None):
			genre = fallback_str
			log.warn(u'no genre for %s in list: fallback to %s' % (album.albumartist, genre))
		if genre is not None:
			log.warn(u'adding genre for %s from list: %s' % (album.albumartist, genre))
			bluo=''
		album.genre = genre
		for item in album.items():
			item.write()
update_cmd.func=update_genres

class GenreListPlugin(plugins.BeetsPlugin):
    def __init__(self):
        super(GenreListPlugin, self).__init__()
        self.import_stages = [self.imported]
        
    def commands(self):
        return [update_cmd]

    def configure(self, config):
        global fallback_str
        global genres
        
        gl_filename = ui.config_val(config, 'genrelist', 'listfile', None)
        # Read the genres tree for canonicalization if enabled.
开发者ID:michl,项目名称:beets,代码行数:33,代码来源:genrelist.py


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