update gronk_add_uuid.py

This commit is contained in:
Akbar Rahman 2023-09-20 22:17:06 +01:00 committed by Akbar Rahman
parent b61f1ba3b2
commit 36f40f3269
Signed by: alvierahman90
GPG Key ID: 6217899F07CA2BDF

21
gronk_add_uuid.py Executable file → Normal file
View File

@ -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)