From bf51e244b481d2048cb40551a063818f429533dc Mon Sep 17 00:00:00 2001 From: Starfall Date: Thu, 21 Oct 2021 20:05:03 -0500 Subject: strike: reduce indentation level slightly --- strike.py | 17 +++++++++-------- 1 file 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()) -- cgit