v0.2.4 基本可用型
This commit is contained in:
17
auxiliary.py
17
auxiliary.py
@@ -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))
|
||||
|
Reference in New Issue
Block a user