update @ Tue 29 Aug 10:51:42 EEST 2023

Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
Ari Archer 2023-08-29 10:51:42 +03:00
parent 42fcd971e0
commit b3c36c2f88
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: A50D5B4B599AF8A2

View file

@ -526,8 +526,8 @@ def open_file(editor: typing.Sequence[str], path: str) -> None:
subprocess.run([(token.replace("%s", path)) for token in editor])
def trunc(data: str, length: int) -> str:
return data[:length] + (" ..." if len(data) > length else "")
def trunc(data: str, length: int, end: str = " ...") -> str:
return data[:length] + (end if len(data) > length else "")
def read_post(path: str) -> str:
@ -1116,7 +1116,7 @@ def apis(config: typing.Dict[str, typing.Any]) -> int:
kv[0],
{
"title": kv[1]["title"],
"content": trunc(kv[1]["content"], config["post-preview-size"]),
"content": trunc(kv[1]["content"], config["post-preview-size"], ""),
"created": kv[1]["created"],
},
),