summaryrefslogtreecommitdiff
path: root/src/pyssg/builder.py
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2022-12-04 15:06:48 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2022-12-04 15:06:48 -0600
commit0bc00ce9352ba843d62c189b68e0e07724cc4b58 (patch)
tree7cfb33a04649f6860f2d29cf0ec124a0f4aa7e3a /src/pyssg/builder.py
parent5794ce299e0283ed98e102ee1faaeaf86206f588 (diff)
migrate from INI to YAML, breaks compatibility
config file and template files need to be converted to the new format to use with YAML config
Diffstat (limited to 'src/pyssg/builder.py')
-rw-r--r--src/pyssg/builder.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pyssg/builder.py b/src/pyssg/builder.py
index 9834e1d..391c7e0 100644
--- a/src/pyssg/builder.py
+++ b/src/pyssg/builder.py
@@ -1,7 +1,6 @@
import os
from copy import deepcopy
from operator import itemgetter
-from configparser import ConfigParser
from logging import Logger, getLogger
from jinja2 import Environment, Template, FileSystemLoader as FSLoader
@@ -15,10 +14,10 @@ log: Logger = getLogger(__name__)
class Builder:
- def __init__(self, config: ConfigParser,
+ def __init__(self, config: dict,
db: Database):
log.debug('initializing site builder')
- self.config: ConfigParser = config
+ self.config: dict = config
self.db: Database = db
# the autoescape option could be a security risk if used in a dynamic
@@ -104,7 +103,8 @@ class Builder:
log.debug('file "%s" has been modified or is new, copying', f)
copy_file(src_file, dst_file)
else:
- if self.config.getboolean('other', 'force'):
+ # TODO: need to check if this holds after yaml update
+ if self.config['info']['force']:
log.debug('file "%s" hasn\'t been modified, but option force is set to true, copying anyways', f)
copy_file(src_file, dst_file)
else:
@@ -117,7 +117,7 @@ class Builder:
temp_files: list[Page]
# check if only updated should be created
- if self.config.getboolean('other', 'force'):
+ if self.config['info']['force']:
log.debug('all html will be rendered, force is set to true')
temp_files = self.all_files
else: