25 lines
583 B
Python
25 lines
583 B
Python
from datetime import datetime
|
|
from pathlib import Path
|
|
|
|
|
|
def get_session_id() -> str:
|
|
current_datetime = datetime.now()
|
|
return current_datetime.strftime("%Y-%m-%d-%H-%M-%S")
|
|
|
|
|
|
def rmtree(root_dir: Path):
|
|
"""removes a folder with content recursively"""
|
|
if not root_dir.is_dir():
|
|
return
|
|
for child in root_dir.iterdir():
|
|
if child.is_dir():
|
|
rmtree(child)
|
|
else:
|
|
child.unlink()
|
|
|
|
root_dir.rmdir()
|
|
|
|
|
|
def make_url(domain: str) -> str:
|
|
"""adds 'http://' at the beginning of a string"""
|
|
return "https://" + domain
|