it works
This commit is contained in:
parent
0017b074f0
commit
c17cec9b46
|
@ -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+')
|
||||
|
|
Loading…
Reference in a new issue