From 80d69a1060a921c589d586f43c31459ee83310e5 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Fri, 18 Dec 2015 12:22:55 +0100 Subject: [PATCH] Remove DEFAULT_CONFIG --- patacrep/build.py | 6 ++---- patacrep/songs/__init__.py | 4 +--- test/test_content/test_content.py | 2 -- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/patacrep/build.py b/patacrep/build.py index 01553bc0..29388952 100644 --- a/patacrep/build.py +++ b/patacrep/build.py @@ -13,7 +13,7 @@ import yaml from patacrep import authors, content, encoding, errors, files, pkg_datapath, utils from patacrep.index import process_sxd from patacrep.templates import TexBookRenderer, iter_bookoptions -from patacrep.songs import DataSubpath, DEFAULT_CONFIG +from patacrep.songs import DataSubpath LOGGER = logging.getLogger(__name__) EOL = "\n" @@ -76,9 +76,7 @@ class Songbook(object): Arguments: - output: a file object, in which the file will be written. """ - # Updating configuration - config = DEFAULT_CONFIG.copy() - config.update(self.config) + config = self.config.copy() renderer = TexBookRenderer( config['book']['template'], config['_datadir'], diff --git a/patacrep/songs/__init__.py b/patacrep/songs/__init__.py index 23c7900f..c3636bca 100644 --- a/patacrep/songs/__init__.py +++ b/patacrep/songs/__init__.py @@ -12,8 +12,6 @@ from patacrep.authors import process_listauthors LOGGER = logging.getLogger(__name__) -DEFAULT_CONFIG = {} - def cached_name(datadir, filename): """Return the filename of the cache version of the file.""" fullpath = os.path.abspath(os.path.join(datadir, '.cache', filename)) @@ -97,7 +95,7 @@ class Song: def __init__(self, subpath, config=None, *, datadir=None): if config is None: - config = DEFAULT_CONFIG.copy() + config = {} if datadir is None: self.datadir = "" diff --git a/test/test_content/test_content.py b/test/test_content/test_content.py index 2bc39d7a..868b8fc5 100644 --- a/test/test_content/test_content.py +++ b/test/test_content/test_content.py @@ -105,8 +105,6 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): with encoding.open_read(default_songbook_path) as default_songbook_file: config = yaml.load(default_songbook_file) - #config = DEFAULT_CONFIG.copy() - datadirpaths = [os.path.join(os.path.dirname(__file__), 'datadir')] # todo : yaml and testing?