1
0
mirror of https://github.com/venthur/blag.git synced 2025-11-25 20:52:43 +00:00

fixed pep8 violations

This commit is contained in:
Bastian Venthur
2018-07-14 21:44:59 +02:00
parent e9c5a17cc8
commit 4de6909e93

11
sg.py
View File

@@ -18,6 +18,7 @@
"""Small static site generator. """Small static site generator.
""" """
@@ -54,10 +55,12 @@ def prepare_site():
# check if all needed dirs and files are available # check if all needed dirs and files are available
for directory in LAYOUTS_DIR, STATIC_DIR: for directory in LAYOUTS_DIR, STATIC_DIR:
if not os.path.exists(directory): if not os.path.exists(directory):
logging.warning("Directory '%s' does not exist, creating it." % directory) logging.warning("Directory {} does not exist, creating it."
.format(directory))
os.mkdir(directory) os.mkdir(directory)
if not os.path.exists(DEFAULT_LAYOUT): if not os.path.exists(DEFAULT_LAYOUT):
logging.warning("File '%s' does not exist, creating it." % DEFAULT_LAYOUT) logging.warning("File {} does not exist, creating it."
.format(DEFAULT_LAYOUT))
filehandle = open(DEFAULT_LAYOUT, 'w') filehandle = open(DEFAULT_LAYOUT, 'w')
filehandle.write(DEFAULT_LAYOUT_HTML) filehandle.write(DEFAULT_LAYOUT_HTML)
filehandle.close() filehandle.close()
@@ -185,8 +188,8 @@ def render_page(path):
if __name__ == "__main__": if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG, format="%(levelname)s\t%(message)s") logging.basicConfig(level=logging.DEBUG,
format="%(levelname)s\t%(message)s")
prepare_site() prepare_site()
copy_static_content() copy_static_content()
generate_site() generate_site()