This commit is contained in:
parent
6912a8d7d3
commit
9bb479dadf
1 changed files with 3 additions and 0 deletions
|
@ -32,6 +32,8 @@ def get_posts() -> list[str]:
|
||||||
|
|
||||||
|
|
||||||
class File:
|
class File:
|
||||||
|
"""file representation"""
|
||||||
|
|
||||||
def __init__(self, content: str, cdate: str):
|
def __init__(self, content: str, cdate: str):
|
||||||
# content
|
# content
|
||||||
self.content = content
|
self.content = content
|
||||||
|
@ -77,6 +79,7 @@ def fresh_file_id() -> int:
|
||||||
|
|
||||||
|
|
||||||
def exist_post(file_id: int) -> float | None:
|
def exist_post(file_id: int) -> float | None:
|
||||||
|
"""check if post exists, return modification epoch"""
|
||||||
try:
|
try:
|
||||||
return os_path.getmtime(post_filename(file_id))
|
return os_path.getmtime(post_filename(file_id))
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
|
|
Loading…
Reference in a new issue