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:
Eshan Singh
2017-12-30 10:55:52 +00:00
parent 75a3d4bce1
commit e2e8676e4d
4 changed files with 16 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ import whipper
from whipper.command import cd, offset, drive, image, accurip, debug
from whipper.command.basecommand import BaseCommand
from whipper.common import common, directory
from whipper.common import common, directory, config
from whipper.extern.task import task
from whipper.program.utils import eject_device
@@ -22,6 +22,7 @@ def main():
# set user agent
musicbrainzngs.set_useragent("whipper", whipper.__version__,
"https://github.com/JoeLametta/whipper")
musicbrainzngs.set_hostname(config.Config().get_musicbrainz_server())
# register plugins with pkg_resources
distributions, _ = pkg_resources.working_set.find_plugins(
pkg_resources.Environment([directory.data_path('plugins')])