From 36f40f3269847a35dd0b8e7e7b5f042731e3d127 Mon Sep 17 00:00:00 2001 From: Alvie Rahman Date: Wed, 20 Sep 2023 22:17:06 +0100 Subject: [PATCH] update gronk_add_uuid.py --- gronk_add_uuid.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) mode change 100755 => 100644 gronk_add_uuid.py diff --git a/gronk_add_uuid.py b/gronk_add_uuid.py old mode 100755 new mode 100644 index 6707d36..1c95940 --- a/gronk_add_uuid.py +++ b/gronk_add_uuid.py @@ -1,11 +1,14 @@ #!/usr/bin/env python3 -import editfrontmatter -import frontmatter + import pathlib import sys import uuid + +import editfrontmatter +import frontmatter + def get_args(): """ Get command line arguments """ @@ -19,13 +22,13 @@ def get_args(): def main(args): """ Entry point for script """ - template_str= [ - "author: {{ author }}" - "date: {{ date }}" - "title: {{ title }}" - "tags: {{ tags }}" - "uuid: {{ uuid }}" - ].join("\n") + template_str= "\n".join([ + "author: {{ author }}" + "date: {{ date }}" + "title: {{ title }}" + "tags: {{ tags }}" + "uuid: {{ uuid }}" + ]) with open(args.filename) as fp: fm_pre = frontmatter.load(fp)