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()
|
||||
space = "\n"
|
||||
|
||||
return "%(date)s %(title)s %(body)s %(space)s" % {
|
||||
'date': date_str,
|
||||
'title': self.title,
|
||||
'body': body,
|
||||
'space': space
|
||||
}
|
||||
return "{date} {title} {body} {space}".format(
|
||||
date=date_str,
|
||||
title=self.title,
|
||||
body=body,
|
||||
space=space
|
||||
)
|
||||
|
||||
def __repr__(self):
|
||||
return str(self)
|
||||
|
@ -51,10 +51,10 @@ class Entry:
|
|||
space = "\n"
|
||||
md_head = "###"
|
||||
|
||||
return "%(md)s %(date)s, %(title)s %(body)s %(space)s" % {
|
||||
'md': md_head,
|
||||
'date': date_str,
|
||||
'title': self.title,
|
||||
'body': body,
|
||||
'space': space
|
||||
}
|
||||
return "{md} {date}, {title} {body} {space}".format(
|
||||
md=md_head,
|
||||
date=date_str,
|
||||
title=self.title,
|
||||
body=body,
|
||||
space=space
|
||||
)
|
Loading…
Add table
Reference in a new issue