本文整理汇总了Python中picard.album.NatAlbum类的典型用法代码示例。如果您正苦于以下问题:Python NatAlbum类的具体用法?Python NatAlbum怎么用?Python NatAlbum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NatAlbum类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_nats
def create_nats(self):
if self.nats is None:
self.nats = NatAlbum()
self.albums["NATS"] = self.nats
self.album_added.emit(self.nats)
self.nats.item.setExpanded(True)
return self.nats
示例2: Tagger
#.........这里部分代码省略.........
def debug(self, debug):
if self._debug == debug:
return
if debug:
log.log_levels = log.log_levels | log.LOG_DEBUG
log.debug("Debug mode on")
else:
log.debug("Debug mode off")
log.log_levels = log.log_levels & ~log.LOG_DEBUG
self._debug = debug
def move_files_to_album(self, files, albumid=None, album=None):
"""Move `files` to tracks on album `albumid`."""
if album is None:
album = self.load_album(albumid)
if album.loaded:
album.match_files(files)
else:
for file in list(files):
file.move(album.unmatched_files)
def move_file_to_album(self, file, albumid):
"""Move `file` to a track on album `albumid`."""
self.move_files_to_album([file], albumid)
def move_file_to_track(self, file, albumid, recordingid):
"""Move `file` to recording `recordingid` on album `albumid`."""
album = self.load_album(albumid)
file.move(album.unmatched_files)
album.run_when_loaded(partial(album.match_file, file, recordingid))
def create_nats(self):
if self.nats is None:
self.nats = NatAlbum()
self.albums["NATS"] = self.nats
self.album_added.emit(self.nats)
return self.nats
def move_file_to_nat(self, file, recordingid, node=None):
self.create_nats()
file.move(self.nats.unmatched_files)
nat = self.load_nat(recordingid, node=node)
nat.run_when_loaded(partial(file.move, nat))
if nat.loaded:
self.nats.update()
def exit(self):
log.debug("exit")
self.stopping = True
self._acoustid.done()
self.thread_pool.waitForDone()
self.browser_integration.stop()
self.xmlws.stop()
for f in self.exit_cleanup:
f()
def _run_init(self):
if self._args:
files = []
for file in self._args:
if os.path.isdir(file):
self.add_directory(decode_filename(file))
else:
files.append(decode_filename(file))
if files:
self.add_files(files)
示例3: create_nats
def create_nats(self):
if self.nats is None:
self.nats = NatAlbum()
self.albums["NATS"] = self.nats
self.album_added.emit(self.nats)
return self.nats
示例4: Tagger
#.........这里部分代码省略.........
remove_va_file_naming_format(merge=False)
else:
remove_va_file_naming_format()
else:
# default format, disabled
remove_va_file_naming_format(merge=False)
cfg.register_upgrade_hook("1.0.0final0", upgrade_to_v1_0)
cfg.run_upgrade_hooks()
def move_files_to_album(self, files, albumid=None, album=None):
"""Move `files` to tracks on album `albumid`."""
if album is None:
album = self.load_album(albumid)
if album.loaded:
album.match_files(files)
else:
for file in list(files):
file.move(album.unmatched_files)
def move_file_to_album(self, file, albumid):
"""Move `file` to a track on album `albumid`."""
self.move_files_to_album([file], albumid)
def move_file_to_track(self, file, albumid, trackid):
"""Move `file` to track `trackid` on album `albumid`."""
album = self.load_album(albumid)
file.move(album.unmatched_files)
album.run_when_loaded(partial(album.match_file, file, trackid))
def create_nats(self):
if self.nats is None:
self.nats = NatAlbum()
self.albums["NATS"] = self.nats
self.album_added.emit(self.nats)
return self.nats
def move_file_to_nat(self, file, trackid, node=None):
self.create_nats()
file.move(self.nats.unmatched_files)
nat = self.load_nat(trackid, node=node)
nat.run_when_loaded(partial(file.move, nat))
if nat.loaded:
self.nats.update()
def exit(self):
self.stopping = True
self._acoustid.done()
self.thread_pool.waitForDone()
self.browser_integration.stop()
self.xmlws.stop()
def _run_init(self):
if self._args:
files = []
for file in self._args:
if os.path.isdir(file):
self.add_directory(decode_filename(file))
else:
files.append(decode_filename(file))
if files:
self.add_files(files)
del self._args
def run(self):
示例5: Tagger
#.........这里部分代码省略.........
self.log.debug("Loading gettext translation, localedir=%r", localedir)
self.translation = gettext.translation("picard", localedir)
self.translation.install(True)
ungettext = self.translation.ungettext
except IOError:
__builtin__.__dict__['_'] = lambda a: a
def ungettext(a, b, c):
if c == 1: return a
else: return b
__builtin__.__dict__['ungettext'] = ungettext
def move_files_to_album(self, files, albumid=None, album=None):
"""Move `files` to tracks on album `albumid`."""
if album is None:
album = self.load_album(albumid)
if album.loaded:
album.match_files(files)
else:
for file in list(files):
file.move(album.unmatched_files)
def move_file_to_album(self, file, albumid):
"""Move `file` to a track on album `albumid`."""
self.move_files_to_album([file], albumid)
def move_file_to_track(self, file, albumid, trackid):
"""Move `file` to track `trackid` on album `albumid`."""
album = self.load_album(albumid)
file.move(album.unmatched_files)
album.run_when_loaded(partial(album.match_file, file, trackid))
def create_nats(self):
if self.nats is None:
self.nats = NatAlbum()
self.albums["NATS"] = self.nats
self.album_added.emit(self.nats)
return self.nats
def move_file_to_nat(self, file, trackid, node=None):
self.create_nats()
file.move(self.nats.unmatched_files)
nat = self.load_nat(trackid, node=node)
nat.run_when_loaded(partial(file.move, nat))
if nat.loaded:
self.nats.update()
def exit(self):
self.stopping = True
self._acoustid.done()
self.thread_pool.stop()
self.browser_integration.stop()
self.xmlws.stop()
def _run_init(self):
if self._args:
files = []
for file in self._args:
if os.path.isdir(file):
self.add_directory(decode_filename(file))
else:
files.append(decode_filename(file))
if files:
self.add_files(files)
del self._args
def run(self):
示例6: Tagger
#.........这里部分代码省略.........
except IOError:
__builtin__.__dict__["_"] = lambda a: a
def ungettext(a, b, c):
if c == 1:
return a
else:
return b
__builtin__.__dict__["ungettext"] = ungettext
def move_files_to_album(self, files, albumid=None, album=None):
"""Move `files` to tracks on album `albumid`."""
if album is None:
album = self.load_album(albumid)
if album.loaded:
album.match_files(files)
else:
for file in list(files):
file.move(album.unmatched_files)
def move_file_to_album(self, file, albumid):
"""Move `file` to a track on album `albumid`."""
self.move_files_to_album([file], albumid)
def move_file_to_track(self, file, albumid, trackid):
"""Move `file` to track `trackid` on album `albumid`."""
album = self.load_album(albumid)
file.move(album.unmatched_files)
album.run_when_loaded(partial(album.match_file, file, trackid))
def create_nats(self):
if self.nats is None:
self.nats = NatAlbum()
self.albums["NATS"] = self.nats
self.album_added.emit(self.nats)
return self.nats
def move_file_to_nat(self, file, trackid, node=None):
self.create_nats()
file.move(self.nats.unmatched_files)
nat = self.load_nat(trackid, node=node)
nat.run_when_loaded(partial(file.move, nat))
if nat.loaded:
self.nats.update()
def exit(self):
self.stopping = True
self._ofa.done()
self._acoustid.done()
self.thread_pool.stop()
self.browser_integration.stop()
self.xmlws.stop()
def _run_init(self):
if self._args:
files = []
for file in self._args:
if os.path.isdir(file):
self.add_directory(decode_filename(file))
else:
files.append(decode_filename(file))
if files:
self.add_files(files)
del self._args
示例7: Tagger
#.........这里部分代码省略.........
@classmethod
def on_mb_login_finished(self, callback, successful):
if successful:
load_user_collections()
callback(successful)
def mb_logout(self):
self.webservice.oauth_manager.revoke_tokens()
load_user_collections()
def move_files_to_album(self, files, albumid=None, album=None):
"""Move `files` to tracks on album `albumid`."""
if album is None:
album = self.load_album(albumid)
if album.loaded:
album.match_files(files)
else:
for file in list(files):
file.move(album.unmatched_files)
def move_file_to_album(self, file, albumid):
"""Move `file` to a track on album `albumid`."""
self.move_files_to_album([file], albumid)
def move_file_to_track(self, file, albumid, recordingid):
"""Move `file` to recording `recordingid` on album `albumid`."""
album = self.load_album(albumid)
file.move(album.unmatched_files)
album.run_when_loaded(partial(album.match_files, [file],
recordingid=recordingid))
def create_nats(self):
if self.nats is None:
self.nats = NatAlbum()
self.albums["NATS"] = self.nats
self.album_added.emit(self.nats)
self.nats.item.setExpanded(True)
return self.nats
def move_file_to_nat(self, file, recordingid, node=None):
self.create_nats()
file.move(self.nats.unmatched_files)
nat = self.load_nat(recordingid, node=node)
nat.run_when_loaded(partial(file.move, nat))
if nat.loaded:
self.nats.update()
def exit(self):
if self.stopping:
return
self.stopping = True
log.debug("Picard stopping")
self._acoustid.done()
self.thread_pool.waitForDone()
self.save_thread_pool.waitForDone()
self.priority_thread_pool.waitForDone()
self.browser_integration.stop()
self.webservice.stop()
self.run_cleanup()
QtCore.QCoreApplication.processEvents()
def _run_init(self):
if self._cmdline_files:
files = []
for file in self._cmdline_files:
if os.path.isdir(file):
示例8: create_nats
def create_nats(self):
if self.nats is None:
self.nats = NatAlbum()
self.albums.append(self.nats)
self.emit(QtCore.SIGNAL("album_added"), self.nats)
return self.nats