mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
parent
d8ccb928e0
commit
cb1561481b
1 changed files with 2 additions and 2 deletions
|
@ -81,7 +81,7 @@ def export(journal, format, output=None):
|
||||||
"markdown": to_md
|
"markdown": to_md
|
||||||
}
|
}
|
||||||
if format not in maps:
|
if format not in maps:
|
||||||
return u"[ERROR: can't export to {0}. Valid options are 'md', 'txt', and 'json']".format(format)
|
return u"[ERROR: can't export to '{0}'. Valid options are 'md', 'txt', and 'json']".format(format)
|
||||||
if output and os.path.isdir(output): # multiple files
|
if output and os.path.isdir(output): # multiple files
|
||||||
return write_files(journal, output, format)
|
return write_files(journal, output, format)
|
||||||
else:
|
else:
|
||||||
|
@ -108,7 +108,7 @@ def write_files(journal, path, format):
|
||||||
elif format in ('md', 'markdown'):
|
elif format in ('md', 'markdown'):
|
||||||
content = e.to_md()
|
content = e.to_md()
|
||||||
elif format in ('txt', 'text'):
|
elif format in ('txt', 'text'):
|
||||||
content = u(e)
|
content = e.__unicode__()
|
||||||
with codecs.open(full_path, "w", "utf-8") as f:
|
with codecs.open(full_path, "w", "utf-8") as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
return u"[Journal exported individual files in {0}]".format(path)
|
return u"[Journal exported individual files in {0}]".format(path)
|
||||||
|
|
Loading…
Add table
Reference in a new issue