about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2021-10-21 20:05:03 -0500
committerStarfall <us@starfall.systems>2023-12-05 10:00:12 -0600
commitbf51e244b481d2048cb40551a063818f429533dc (patch)
tree6220ffb25ccc543b769fa2a21b0fc474be57f11f
parent2028e9fceb6222a9d8f21959792584e8ceeb040c (diff)
strike: reduce indentation level slightly
-rwxr-xr-xstrike.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/strike.py b/strike.py
index e3e5e52..fb7378d 100755
--- a/strike.py
+++ b/strike.py
@@ -7,20 +7,21 @@ def get_output(content, template="{content}"):
 
 def main():
     src = 'blog'
-    dest = 'output'
-    template = 'template'
 
+    dest = 'output'
     try: mkdir(dest)
     except FileExistsError: pass
 
+    template = 'template'
     with open(template) as t:
         template_contents = t.read()
-        for file in listdir(src):
-            with open(src + '/' + file, 'r') as fin:
-                file_contents = fin.read()
-                output = get_output(file_contents, template=template_contents)
-                with open(dest + '/' + file, 'w') as fout:
-                    fout.write(output)
+
+    for file in listdir(src):
+        with open(src + '/' + file, 'r') as fin:
+            file_contents = fin.read()
+        output = get_output(file_contents, template=template_contents)
+        with open(dest + '/' + file, 'w') as fout:
+            fout.write(output)
 
 if __name__ == '__main__':
     exit(main())