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]