diff --git a/jrnl/Entry.py b/jrnl/Entry.py index 5fbdeb15..32c76b12 100644 --- a/jrnl/Entry.py +++ b/jrnl/Entry.py @@ -58,7 +58,7 @@ class Entry: ) def __repr__(self): - return "".format(self.title.strip(), self.date.strftime("%Y-%m-%d %H:%M")) + return "".format(self.title.strip(), self.date.strftime("%Y-%m-%d %H:%M")) def to_dict(self): return { diff --git a/jrnl/Journal.py b/jrnl/Journal.py index 61d6c618..11b31952 100644 --- a/jrnl/Journal.py +++ b/jrnl/Journal.py @@ -181,7 +181,7 @@ class Journal(object): return self.__unicode__() def __repr__(self): - return "".format(len(self.entries)) + return "".format(len(self.entries)) def write(self, filename=None): """Dumps the journal into the config file, overwriting it""" @@ -234,7 +234,7 @@ class Journal(object): for m in matches: date = e.date.strftime(self.config['timeformat']) excerpt = e.body[m.start():min(len(e.body), m.end()+60)] - res.append('{} {} ..'.format(date, excerpt)) + res.append('{0} {1} ..'.format(date, excerpt)) e.body = "\n".join(res) else: for e in self.entries: diff --git a/jrnl/exporters.py b/jrnl/exporters.py index 42126802..7d2eaa93 100644 --- a/jrnl/exporters.py +++ b/jrnl/exporters.py @@ -87,16 +87,16 @@ def export(journal, format, output=None): try: with open(output, 'w') as f: f.write(content) - return "[Journal exported to {}]".format(output) + return "[Journal exported to {0}]".format(output) except IOError as e: - return "[ERROR: {} {}]".format(e.filename, e.strerror) + return "[ERROR: {0} {1}]".format(e.filename, e.strerror) else: return content 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_{}.{}".format(slugify(u(e.title)), format)) + make_filename = lambda entry: e.date.strftime("%C-%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': @@ -107,4 +107,4 @@ def write_files(journal, path, format): content = u(e) with open(full_path, 'w') as f: f.write(content) - return "[Journal exported individual files in {}]".format(path) + return "[Journal exported individual files in {0}]".format(path) diff --git a/jrnl/jrnl.py b/jrnl/jrnl.py index 7f30ad49..639e33d0 100755 --- a/jrnl/jrnl.py +++ b/jrnl/jrnl.py @@ -123,7 +123,7 @@ def cli(manual_args=None): try: config = json.load(f) except ValueError as e: - util.prompt("[There seems to be something wrong with your jrnl config at {}: {}]".format(CONFIG_PATH, e.message)) + util.prompt("[There seems to be something wrong with your jrnl config at {0}: {1}]".format(CONFIG_PATH, e.message)) util.prompt("[Entry was NOT added to your journal]") sys.exit(1) install.update_config(config, config_path=CONFIG_PATH) @@ -155,7 +155,7 @@ def cli(manual_args=None): "entries" in os.listdir(config['journal']): journal = Journal.DayOne(**config) else: - util.prompt("[Error: {} is a directory, but doesn't seem to be a DayOne journal either.".format(config['journal'])) + util.prompt("[Error: {0} is a directory, but doesn't seem to be a DayOne journal either.".format(config['journal'])) sys.exit(1) else: journal = Journal.Journal(**config)