From 5794ce299e0283ed98e102ee1faaeaf86206f588 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Sun, 4 Dec 2022 11:10:40 -0600 Subject: change syntax for accessing config variable --- src/pyssg/pyssg.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/pyssg/pyssg.py') diff --git a/src/pyssg/pyssg.py b/src/pyssg/pyssg.py index a496b34..2734a99 100644 --- a/src/pyssg/pyssg.py +++ b/src/pyssg/pyssg.py @@ -52,6 +52,7 @@ def main() -> None: log.debug('changed logging level to DEBUG') config_path: str = str(args['config']) if args['config'] else DEFAULT_CONFIG_PATH + # only needed for the DEFAULT_CONFIG_PATH config_path = get_expanded_path(config_path) config_dir, _ = os.path.split(config_path) log.debug('checked config file path, final config path "%s"', config_path) @@ -74,9 +75,9 @@ def main() -> None: if args['init']: log.info('initializing the directory structure and copying over templates') - create_dir(config.get('path', 'src')) - create_dir(os.path.join(config.get('path', 'dst'), 'tag'), True) - create_dir(config.get('path', 'plt')) + create_dir(config['path']['src']) + create_dir(os.path.join(config['path']['dst'], 'tag'), True) + create_dir(config['path']['plt']) files: list[str] = ['index.html', 'page.html', 'tag.html', @@ -84,7 +85,7 @@ def main() -> None: 'sitemap.xml'] log.debug('list of files to copy over: (%s)', ', '.join(files)) for f in files: - plt_file: str = os.path.join(config.get('path', 'plt'), f) + plt_file: str = os.path.join(config['path']['plt'], f) with rpath('pyssg.plt', f) as p: copy_file(str(p), plt_file) log.info('finished initialization') @@ -93,7 +94,7 @@ def main() -> None: if args['build']: log.info('building the html files') - db_path: str = os.path.join(config.get('path', 'src'), '.files') + db_path: str = os.path.join(config['path']['src'], '.files') db: Database = Database(db_path, config) db.read() -- cgit v1.2.3-54-g00ecf