mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Using string.format instead of %
This commit is contained in:
parent
bfcdb2928f
commit
dd824c4f8d
1 changed files with 13 additions and 13 deletions
|
@ -26,12 +26,12 @@ class Entry:
|
||||||
body = body_wrapper + self.body.strip()
|
body = body_wrapper + self.body.strip()
|
||||||
space = "\n"
|
space = "\n"
|
||||||
|
|
||||||
return "%(date)s %(title)s %(body)s %(space)s" % {
|
return "{date} {title} {body} {space}".format(
|
||||||
'date': date_str,
|
date=date_str,
|
||||||
'title': self.title,
|
title=self.title,
|
||||||
'body': body,
|
body=body,
|
||||||
'space': space
|
space=space
|
||||||
}
|
)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return str(self)
|
return str(self)
|
||||||
|
@ -51,10 +51,10 @@ class Entry:
|
||||||
space = "\n"
|
space = "\n"
|
||||||
md_head = "###"
|
md_head = "###"
|
||||||
|
|
||||||
return "%(md)s %(date)s, %(title)s %(body)s %(space)s" % {
|
return "{md} {date}, {title} {body} {space}".format(
|
||||||
'md': md_head,
|
md=md_head,
|
||||||
'date': date_str,
|
date=date_str,
|
||||||
'title': self.title,
|
title=self.title,
|
||||||
'body': body,
|
body=body,
|
||||||
'space': space
|
space=space
|
||||||
}
|
)
|
Loading…
Add table
Reference in a new issue