Spaces:
Building
Building
Create utils.py
Browse files
utils.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
import sys
|
3 |
+
from datetime import datetime
|
4 |
+
|
5 |
+
def log(message):
|
6 |
+
timestamp = datetime.now().strftime("%H:%M:%S")
|
7 |
+
print(f"[{timestamp}] {message}")
|
8 |
+
sys.stdout.flush()
|
9 |
+
|
10 |
+
def save_service_config(config):
|
11 |
+
with open("service_config.json", "w") as f:
|
12 |
+
json.dump(config.data, f, indent=2)
|