update gronk_add_uuid.py
This commit is contained in:
parent
b61f1ba3b2
commit
36f40f3269
21
gronk_add_uuid.py
Executable file → Normal file
21
gronk_add_uuid.py
Executable file → Normal file
@ -1,11 +1,14 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import editfrontmatter
|
|
||||||
import frontmatter
|
|
||||||
import pathlib
|
import pathlib
|
||||||
import sys
|
import sys
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
|
||||||
|
import editfrontmatter
|
||||||
|
import frontmatter
|
||||||
|
|
||||||
def get_args():
|
def get_args():
|
||||||
""" Get command line arguments """
|
""" Get command line arguments """
|
||||||
|
|
||||||
@ -19,13 +22,13 @@ def get_args():
|
|||||||
|
|
||||||
def main(args):
|
def main(args):
|
||||||
""" Entry point for script """
|
""" Entry point for script """
|
||||||
template_str= [
|
template_str= "\n".join([
|
||||||
"author: {{ author }}"
|
"author: {{ author }}"
|
||||||
"date: {{ date }}"
|
"date: {{ date }}"
|
||||||
"title: {{ title }}"
|
"title: {{ title }}"
|
||||||
"tags: {{ tags }}"
|
"tags: {{ tags }}"
|
||||||
"uuid: {{ uuid }}"
|
"uuid: {{ uuid }}"
|
||||||
].join("\n")
|
])
|
||||||
|
|
||||||
with open(args.filename) as fp:
|
with open(args.filename) as fp:
|
||||||
fm_pre = frontmatter.load(fp)
|
fm_pre = frontmatter.load(fp)
|
||||||
|
Reference in New Issue
Block a user