PagerMaid-Pyro/pagermaid/update/v1402.py

28 lines
489 B
Python
Raw Normal View History

from pathlib import Path
2023-12-12 12:51:22 +00:00
def rename(old: Path):
if old.exists():
old_file_name = old.name
new = Path("data") / old_file_name
if new.exists():
new.unlink()
old.rename(new)
# move file
# session
session = Path("pagermaid.session")
2023-12-12 12:51:22 +00:00
rename(session)
# config
config = Path("config.yml")
2023-12-12 12:51:22 +00:00
rename(config)
# docker
docker = Path("install.lock")
rename(docker)
# delete file
# log
log = Path("pagermaid.log.txt")
if log.exists():
log.unlink()