rename our musicbrainzngs.py to mbngs.py
Helps Debian package which prefers to strip out our copy of musicbrainzngs
This commit is contained in:
@@ -16,7 +16,7 @@ morituri_PYTHON = \
|
||||
gstreamer.py \
|
||||
log.py \
|
||||
logcommand.py \
|
||||
musicbrainzngs.py \
|
||||
mbngs.py \
|
||||
program.py \
|
||||
renamer.py \
|
||||
task.py
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# -*- Mode: Python; test-case-name: morituri.test.test_common_musicbrainzngs -*-
|
||||
# -*- Mode: Python; test-case-name: morituri.test.test_common_mbngs -*-
|
||||
# vi:si:et:sw=4:sts=4:ts=4
|
||||
|
||||
# Morituri - for those about to RIP
|
||||
@@ -90,7 +90,7 @@ def _record(record, which, name, what):
|
||||
handle = open(filename, 'w')
|
||||
handle.write(json.dumps(what))
|
||||
handle.close()
|
||||
log.info('musicbrainzngs', 'Wrote %s %s to %s', which, name, filename)
|
||||
log.info('mbngs', 'Wrote %s %s to %s', which, name, filename)
|
||||
|
||||
|
||||
def _getMetadata(releaseShort, release, discid):
|
||||
@@ -117,7 +117,7 @@ def _getMetadata(releaseShort, release, discid):
|
||||
artist = credit[0]['artist']
|
||||
|
||||
if len(credit) > 1:
|
||||
log.debug('musicbrainzngs', 'artist-credit more than 1: %r', credit)
|
||||
log.debug('mbngs', 'artist-credit more than 1: %r', credit)
|
||||
|
||||
for i, c in enumerate(credit):
|
||||
if isinstance(c, dict):
|
||||
@@ -136,7 +136,7 @@ def _getMetadata(releaseShort, release, discid):
|
||||
metadata.sortName = artist['sort-name']
|
||||
# FIXME: is format str ?
|
||||
if not 'date' in release:
|
||||
log.warning('musicbrainzngs', 'Release %r does not have date', release)
|
||||
log.warning('mbngs', 'Release %r does not have date', release)
|
||||
else:
|
||||
metadata.release = release['date']
|
||||
|
||||
@@ -170,7 +170,7 @@ def _getMetadata(releaseShort, release, discid):
|
||||
track = TrackMetadata()
|
||||
credit = t['recording']['artist-credit']
|
||||
if len(credit) > 1:
|
||||
log.debug('musicbrainzngs',
|
||||
log.debug('mbngs',
|
||||
'artist-credit more than 1: %r', credit)
|
||||
# credit is of the form [dict, str, dict, ... ]
|
||||
for i, c in enumerate(credit):
|
||||
@@ -28,7 +28,7 @@ import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
from morituri.common import common, log, musicbrainzngs, cache
|
||||
from morituri.common import common, log, mbngs, cache
|
||||
from morituri.program import cdrdao, cdparanoia
|
||||
from morituri.image import image
|
||||
|
||||
@@ -301,11 +301,11 @@ class Program(log.Loggable):
|
||||
|
||||
for _ in range(0, 4):
|
||||
try:
|
||||
metadatas = musicbrainzngs.musicbrainz(mbdiscid,
|
||||
metadatas = mbngs.musicbrainz(mbdiscid,
|
||||
record=self._record)
|
||||
except musicbrainzngs.NotFoundException, e:
|
||||
except mbngs.NotFoundException, e:
|
||||
break
|
||||
except musicbrainzngs.MusicBrainzException, e:
|
||||
except mbngs.MusicBrainzException, e:
|
||||
self._stdout.write("Warning: %r\n" % (e, ))
|
||||
time.sleep(5)
|
||||
continue
|
||||
|
||||
@@ -196,8 +196,8 @@ Example disc id: KnpGsLhvH.lPrNc1PBL21lb9Bg4-"""
|
||||
self.stdout.write('Please specify a MusicBrainz disc id.\n')
|
||||
return 3
|
||||
|
||||
from morituri.common import musicbrainzngs
|
||||
metadatas = musicbrainzngs.musicbrainz(discId)
|
||||
from morituri.common import mbngs
|
||||
metadatas = mbngs.musicbrainz(discId)
|
||||
|
||||
self.stdout.write('%d releases\n' % len(metadatas))
|
||||
for i, md in enumerate(metadatas):
|
||||
|
||||
@@ -11,7 +11,7 @@ EXTRA_DIST = \
|
||||
test_common_drive.py \
|
||||
test_common_encode.py \
|
||||
test_common_gstreamer.py \
|
||||
test_common_musicbrainzngs.py \
|
||||
test_common_mbngs.py \
|
||||
test_common_program.py \
|
||||
test_common_renamer.py \
|
||||
test_image_cue.py \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# -*- Mode: Python; test-case-name: morituri.test.test_common_musicbrainzngs -*-
|
||||
# -*- Mode: Python; test-case-name: morituri.test.test_common_mbngs -*-
|
||||
# vi:si:et:sw=4:sts=4:ts=4
|
||||
|
||||
import os
|
||||
@@ -6,7 +6,7 @@ import json
|
||||
|
||||
import unittest
|
||||
|
||||
from morituri.common import musicbrainzngs
|
||||
from morituri.common import mbngs
|
||||
|
||||
|
||||
class MetadataTestCase(unittest.TestCase):
|
||||
@@ -19,6 +19,6 @@ class MetadataTestCase(unittest.TestCase):
|
||||
handle.close()
|
||||
discid = "wbjbST2jUHRZaB1inCyxxsL7Eqc-"
|
||||
|
||||
metadata = musicbrainzngs._getMetadata({}, response['release'], discid)
|
||||
metadata = mbngs._getMetadata({}, response['release'], discid)
|
||||
|
||||
self.failIf(metadata.release)
|
||||
@@ -7,7 +7,7 @@ import pickle
|
||||
import unittest
|
||||
|
||||
from morituri.result import result
|
||||
from morituri.common import program, accurip, musicbrainzngs
|
||||
from morituri.common import program, accurip, mbngs
|
||||
from morituri.rip import common as rcommon
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ class PathTestCase(unittest.TestCase):
|
||||
|
||||
def testStandardTemplateFilled(self):
|
||||
prog = program.Program()
|
||||
md = musicbrainzngs.DiscMetadata()
|
||||
md = mbngs.DiscMetadata()
|
||||
md.artist = md.sortName = 'Jeff Buckley'
|
||||
md.title = 'Grace'
|
||||
prog.metadata = md
|
||||
@@ -107,7 +107,7 @@ class PathTestCase(unittest.TestCase):
|
||||
|
||||
def testIssue66TemplateFilled(self):
|
||||
prog = program.Program()
|
||||
md = musicbrainzngs.DiscMetadata()
|
||||
md = mbngs.DiscMetadata()
|
||||
md.artist = md.sortName = 'Jeff Buckley'
|
||||
md.title = 'Grace'
|
||||
prog.metadata = md
|
||||
|
||||
Reference in New Issue
Block a user