Browse Source

Remove DEFAULT_CONFIG

pull/184/head
Oliverpool 9 years ago
parent
commit
80d69a1060
  1. 6
      patacrep/build.py
  2. 4
      patacrep/songs/__init__.py
  3. 2
      test/test_content/test_content.py

6
patacrep/build.py

@ -13,7 +13,7 @@ import yaml
from patacrep import authors, content, encoding, errors, files, pkg_datapath, utils from patacrep import authors, content, encoding, errors, files, pkg_datapath, utils
from patacrep.index import process_sxd from patacrep.index import process_sxd
from patacrep.templates import TexBookRenderer, iter_bookoptions from patacrep.templates import TexBookRenderer, iter_bookoptions
from patacrep.songs import DataSubpath, DEFAULT_CONFIG from patacrep.songs import DataSubpath
LOGGER = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
EOL = "\n" EOL = "\n"
@ -76,9 +76,7 @@ class Songbook(object):
Arguments: Arguments:
- output: a file object, in which the file will be written. - output: a file object, in which the file will be written.
""" """
# Updating configuration config = self.config.copy()
config = DEFAULT_CONFIG.copy()
config.update(self.config)
renderer = TexBookRenderer( renderer = TexBookRenderer(
config['book']['template'], config['book']['template'],
config['_datadir'], config['_datadir'],

4
patacrep/songs/__init__.py

@ -12,8 +12,6 @@ from patacrep.authors import process_listauthors
LOGGER = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
DEFAULT_CONFIG = {}
def cached_name(datadir, filename): def cached_name(datadir, filename):
"""Return the filename of the cache version of the file.""" """Return the filename of the cache version of the file."""
fullpath = os.path.abspath(os.path.join(datadir, '.cache', filename)) fullpath = os.path.abspath(os.path.join(datadir, '.cache', filename))
@ -97,7 +95,7 @@ class Song:
def __init__(self, subpath, config=None, *, datadir=None): def __init__(self, subpath, config=None, *, datadir=None):
if config is None: if config is None:
config = DEFAULT_CONFIG.copy() config = {}
if datadir is None: if datadir is None:
self.datadir = "" self.datadir = ""

2
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: with encoding.open_read(default_songbook_path) as default_songbook_file:
config = yaml.load(default_songbook_file) config = yaml.load(default_songbook_file)
#config = DEFAULT_CONFIG.copy()
datadirpaths = [os.path.join(os.path.dirname(__file__), 'datadir')] datadirpaths = [os.path.join(os.path.dirname(__file__), 'datadir')]
# todo : yaml and testing? # todo : yaml and testing?

Loading…
Cancel
Save