[SCM] morituri/master: * morituri/rip/debug.py: Add rip debug musicbrainz command to look up information on disc id's.
js at users.alioth.debian.org
js at users.alioth.debian.org
Sun Oct 19 20:09:36 UTC 2014
The following commit has been merged in the master branch:
commit fa1fba9bc270165392b936b0734d1902c6cfe488
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date: Wed Oct 19 18:15:42 2011 +0000
* morituri/rip/debug.py:
Add rip debug musicbrainz command to look up information on
disc id's.
diff --git a/ChangeLog b/ChangeLog
index f6bf753..5098ba7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2011-10-19 Thomas Vander Stichele <thomas at apestaart dot org>
+ * morituri/rip/debug.py:
+ Add rip debug musicbrainz command to look up information on
+ disc id's.
+
+2011-10-19 Thomas Vander Stichele <thomas at apestaart dot org>
+
* morituri/common/Makefile.am:
* morituri/common/musicbrainz.py:
* morituri/common/program.py:
diff --git a/morituri/rip/debug.py b/morituri/rip/debug.py
index 8e076d4..dac5972 100644
--- a/morituri/rip/debug.py
+++ b/morituri/rip/debug.py
@@ -82,9 +82,33 @@ class Encode(logcommand.LogCommand):
runner.run(encodetask)
-class Debug(logcommand.LogCommand):
- summary = "debug internals"
+class MusicBrainz(logcommand.LogCommand):
+
+ summary = "examine MusicBrainz info"
+
+
+ def do(self, args):
+ try:
+ discId = unicode(args[0])
+ except IndexError:
+ self.stdout.write('Please specify a MusicBrainz disc id.\n')
+ return 3
- subCommandClasses = [Checksum, Encode, ]
+ from morituri.common import program
+ metadatas = program.musicbrainz(discId)
+ self.stdout.write('%d releases\n' % len(metadatas))
+ for i, md in enumerate(metadatas):
+ self.stdout.write('- Release %d:\n' % (i + 1, ))
+ self.stdout.write(' Artist: %r\n' % md.artist)
+ self.stdout.write(' Title: %r\n' % md.title)
+ self.stdout.write(' URL: %r\n' % md.url)
+ self.stdout.write(' Tracks: %r\n' % len(md.tracks))
+ for j, track in enumerate(md.tracks):
+ self.stdout.write(' Track %2d: %r - %r\n' % (
+ j, track.artist, track.title))
+
+class Debug(logcommand.LogCommand):
+ summary = "debug internals"
+ subCommandClasses = [Checksum, Encode, MusicBrainz, ]
--
morituri packaging
More information about the pkg-multimedia-commits
mailing list