v0.2.4 基本可用型

This commit is contained in:
2025-07-25 22:04:46 +08:00
parent c679704e56
commit 3411765be7
9 changed files with 77 additions and 31 deletions

View File

@@ -2,10 +2,6 @@ import time
import pathlib
import toml
def get_daystamp():
#print("Daystamp: ", (time.time() // (24*3600))) # 20292.0
return (time.time() // (24*3600))
class ConfigFile():
def __init__(self, path):
self.path = pathlib.Path(path)
@@ -23,4 +19,15 @@ class ConfigFile():
with open(path, 'w') as f:
toml.dump(self.data, f)
def get(self, key, default = None):
pass
return self.data.get(key, default)
def get_daystamp() -> int:
config = ConfigFile("config.toml")
time_override = config.get("time_override", -1)
if time_override is not None and time_override != -1:
print(f"TIME OVERRIDEED TO {time_override}")
return int(time_override)
return int(time.time() // (24 * 3600))