mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 21:46:13 +02:00
Better Python2.6 compatibility
This commit is contained in:
parent
13f8e668dc
commit
29005c0e07
3 changed files with 4 additions and 4 deletions
|
@ -152,7 +152,8 @@ class Journal(object):
|
|||
except ValueError:
|
||||
# Happens when we can't parse the start of the line as an date.
|
||||
# In this case, just append line to our body.
|
||||
current_entry.body += line + "\n"
|
||||
if current_entry:
|
||||
current_entry.body += line + "\n"
|
||||
|
||||
# Append last entry
|
||||
if current_entry:
|
||||
|
@ -173,7 +174,7 @@ class Journal(object):
|
|||
lambda match: self._colorize(match.group(0)),
|
||||
pp, re.UNICODE)
|
||||
else:
|
||||
pp = re.sub(r"(?u)([{}]\w+)".format(self.config['tagsymbols']),
|
||||
pp = re.sub(r"(?u)([{tags}]\w+)".format(tags=self.config['tagsymbols']),
|
||||
lambda match: self._colorize(match.group(0)),
|
||||
pp)
|
||||
return pp
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue