From 326caa84a8a96a4ab37d979b1ecb0fd4468368b6 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Thu, 6 Dec 2012 17:16:41 +0000 Subject: [PATCH] * morituri/rip/debug.py: Add rip debug tag to debug reading tags. --- ChangeLog | 5 +++++ morituri/rip/debug.py | 24 +++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bb57c78..7ec0402 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-12-06 Thomas Vander Stichele + + * morituri/rip/debug.py: + Add rip debug tag to debug reading tags. + 2012-12-06 Thomas Vander Stichele * morituri/rip/image.py: diff --git a/morituri/rip/debug.py b/morituri/rip/debug.py index 2deae0d..0dfbe48 100644 --- a/morituri/rip/debug.py +++ b/morituri/rip/debug.py @@ -155,6 +155,28 @@ class Encode(logcommand.LogCommand): runner.run(encodetask) +class Tag(logcommand.LogCommand): + + summary = "run a tag reading task" + + def do(self, args): + try: + path = unicode(args[0]) + except IndexError: + self.stdout.write('Please specify an input file.\n') + return 3 + + runner = task.SyncRunner() + + from morituri.common import encode + self.debug('Reading tags from %s' % path.encode('utf-8')) + tagtask = encode.TagReadTask(path) + + runner.run(tagtask) + + for key in tagtask.taglist.keys(): + self.stdout.write('%s: %r\n' % (key, tagtask.taglist[key])) + class MusicBrainzNGS(logcommand.LogCommand): @@ -187,4 +209,4 @@ class Debug(logcommand.LogCommand): summary = "debug internals" - subCommandClasses = [Checksum, Encode, MusicBrainzNGS, ResultCache] + subCommandClasses = [Checksum, Encode, Tag, MusicBrainzNGS, ResultCache]