本文整理汇总了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]
示例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]
示例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]
示例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]
示例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]
示例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]
示例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]
示例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]
示例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]
示例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]
示例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]
示例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]
示例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]
示例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]
示例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.