From c17cec9b46bf17d8d9fd22fe3de1f74b27e642a7 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Tue, 20 Oct 2020 22:55:13 +1000 Subject: [PATCH] it works --- tiddly2kitaab.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tiddly2kitaab.py b/tiddly2kitaab.py index defcd1f..b485b5c 100644 --- a/tiddly2kitaab.py +++ b/tiddly2kitaab.py @@ -15,19 +15,23 @@ def createFile(tiddler): # create the filename filename = created[2:8] # YYMMDD filename = filename + "-" - hour = title[-5:].replace(':', '') - filename = filename+hour+'.wiki' + hour = title[-5:] + time = hour.replace(':', '') + filename = filename+time+'.wiki' # handle tags allTags = ':' - for t in tags: + tagList = tags.replace('[', '').replace(']', '').split(' ') # Ugly one liner + for t in tagList: + if t == 'Journal': + t = 'jrnl' allTags = allTags + t + ':' # handle date date = created[:4] + '-' + created[4:6] + '-' + created[6:8] + ' ' + hour # create write list - writeList = ['%title {title}', allTags, '%date {date}', '', text] + writeList = ['%title {}\n'.format(title), allTags, '\n', '%date {}\n'.format(date), '\n', text] # create and write the file file = open('./jrnl/'+filename, 'w+')