Enable connecting to a custom MusicBrainz server
Under the new [musicbrainz] section in the config, you can set a server to connect to. Closes #172.
This commit is contained in:
@@ -21,9 +21,11 @@
|
||||
import ConfigParser
|
||||
import codecs
|
||||
import os.path
|
||||
import re
|
||||
import shutil
|
||||
import tempfile
|
||||
import urllib
|
||||
from urlparse import urlparse
|
||||
|
||||
from whipper.common import directory
|
||||
|
||||
@@ -72,6 +74,13 @@ class Config:
|
||||
def getboolean(self, section, option):
|
||||
return self._getter('boolean', section, option)
|
||||
|
||||
# musicbrainz section
|
||||
|
||||
def get_musicbrainz_server(self):
|
||||
server = self.get('musicbrainz', 'server') or 'musicbrainz.org'
|
||||
server_url = server if re.match(r'^\D*//', server) else '//' + server
|
||||
return urlparse(server_url).netloc
|
||||
|
||||
# drive sections
|
||||
|
||||
def setReadOffset(self, vendor, model, release, offset):
|
||||
|
||||
Reference in New Issue
Block a user