Include the year in exported file name

This commit is contained in:
Jacobo de Vera 2014-06-30 07:01:33 +02:00
parent 3f5b5ff3c3
commit b423bfc963

View file

@ -100,7 +100,7 @@ def export(journal, format, output=None):
def write_files(journal, path, format): def write_files(journal, path, format):
"""Turns your journal into separate files for each entry. """Turns your journal into separate files for each entry.
Format should be either json, md or txt.""" 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: for e in journal.entries:
full_path = os.path.join(path, make_filename(e)) full_path = os.path.join(path, make_filename(e))
if format == 'json': if format == 'json':