File diff 6d1a7cb57da4 → cdec3d9aabf8
import2ledger/config.py
Show inline comments
...
 
@@ -9,7 +9,7 @@ import pathlib
 

	
 
import babel
 
import babel.numbers
 
from . import errors, strparse, template
 
from . import errors, strparse
 

	
 
class Configuration:
 
    HOME_PATH = pathlib.Path(os.path.expanduser('~'))
...
 
@@ -241,24 +241,6 @@ class Configuration:
 
        path = self.get_output_path(section_name)
 
        return self._open_path(path, self.stdout, 'a')
 

	
 
    def get_template(self, config_key, section_name=None, factory=template.Template):
 
        section_config = self.get_section(section_name)
 
        try:
 
            template_s = section_config[config_key]
 
        except KeyError:
 
            raise errors.UserInputConfigurationError(
 
                "template not defined in [{}]".format(section_name or self.args.use_config),
 
                config_key,
 
            )
 
        return factory(
 
            template_s,
 
            date_fmt=section_config['date_format'],
 
            signed_currencies=[code.strip().upper() for code in section_config['signed_currencies'].split(',')],
 
            signed_currency_fmt=section_config['signed_currency_format'],
 
            unsigned_currency_fmt=section_config['unsigned_currency_format'],
 
            template_name=config_key,
 
        )
 

	
 
    def setup_logger(self, logger, section_name=None):
 
        logger.setLevel(self.get_loglevel(section_name))