mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
fix a few linting errors
This commit is contained in:
parent
97f8a4751e
commit
b84f862253
1 changed files with 9 additions and 3 deletions
|
@ -118,7 +118,6 @@ class Journal(object):
|
||||||
last_entry_pos = match.end()
|
last_entry_pos = match.end()
|
||||||
entries.append(Entry.Entry(self, date=new_date))
|
entries.append(Entry.Entry(self, date=new_date))
|
||||||
|
|
||||||
|
|
||||||
# If no entries were found, treat all the existing text as an entry made now
|
# If no entries were found, treat all the existing text as an entry made now
|
||||||
if not entries:
|
if not entries:
|
||||||
entries.append(Entry.Entry(self, date=time.parse("now")))
|
entries.append(Entry.Entry(self, date=time.parse("now")))
|
||||||
|
@ -218,7 +217,11 @@ class Journal(object):
|
||||||
if not date:
|
if not date:
|
||||||
colon_pos = first_line.find(": ")
|
colon_pos = first_line.find(": ")
|
||||||
if colon_pos > 0:
|
if colon_pos > 0:
|
||||||
date = time.parse(raw[:colon_pos], default_hour=self.config['default_hour'], default_minute=self.config['default_minute'])
|
date = time.parse(
|
||||||
|
raw[:colon_pos],
|
||||||
|
default_hour=self.config['default_hour'],
|
||||||
|
default_minute=self.config['default_minute']
|
||||||
|
)
|
||||||
if date: # Parsed successfully, strip that from the raw text
|
if date: # Parsed successfully, strip that from the raw text
|
||||||
starred = raw[:colon_pos].strip().endswith("*")
|
starred = raw[:colon_pos].strip().endswith("*")
|
||||||
raw = raw[colon_pos + 1:].strip()
|
raw = raw[colon_pos + 1:].strip()
|
||||||
|
@ -325,7 +328,10 @@ def open_journal(name, config, legacy=False):
|
||||||
from . import DayOneJournal
|
from . import DayOneJournal
|
||||||
return DayOneJournal.DayOne(**config).open()
|
return DayOneJournal.DayOne(**config).open()
|
||||||
else:
|
else:
|
||||||
util.prompt(u"[Error: {0} is a directory, but doesn't seem to be a DayOne journal either.".format(config['journal']))
|
util.prompt(
|
||||||
|
u"[Error: {0} is a directory, but doesn't seem to be a DayOne journal either.".format(config['journal'])
|
||||||
|
)
|
||||||
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if not config['encrypt']:
|
if not config['encrypt']:
|
||||||
|
|
Loading…
Add table
Reference in a new issue