Include the year in exported file name

This commit is contained in:
Jacobo de Vera 2014-06-30 07:01:33 +02:00 committed by William Minchin
parent a317e594e6
commit 273f7eb9c4

View file

@ -100,7 +100,7 @@ def export(journal, format, output=None):
def write_files(journal, path, format):
"""Turns your journal into separate files for each entry.
Format should be either json, md or txt."""
make_filename = lambda entry: e.date.strftime("%C-%m-%d_{0}.{1}".format(slugify(u(e.title)), format))
make_filename = lambda entry: e.date.strftime("%Y-%m-%d_{0}.{1}".format(slugify(u(e.title)), format))
for e in journal.entries:
full_path = os.path.join(path, make_filename(e))
if format == 'json':