summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2025-01-06 03:57:34 +0100
committererdgeist <erdgeist@erdgeist.org>2025-01-06 03:57:34 +0100
commit89f1f4006662f47186b32a38a5d85de5935512e5 (patch)
tree81e8367280295cb2d853712a0565791a165312a0
parentd038549d9e01ce37f6decbbf51aa396fc7c57a96 (diff)
Formatted
-rw-r--r--fullnarp.py11
-rwxr-xr-xhalfnarp2.py2
2 files changed, 10 insertions, 3 deletions
diff --git a/fullnarp.py b/fullnarp.py
index 0500d1b..1085732 100644
--- a/fullnarp.py
+++ b/fullnarp.py
@@ -49,6 +49,7 @@ SessionLocal = None
49Base = declarative_base() 49Base = declarative_base()
50fullnarp_path = "" 50fullnarp_path = ""
51 51
52
52class TalkPreference(Base): 53class TalkPreference(Base):
53 __tablename__ = "talk_preference" 54 __tablename__ = "talk_preference"
54 uid = Column(String, primary_key=True) 55 uid = Column(String, primary_key=True)
@@ -75,7 +76,10 @@ async def notify_clients():
75 message = { 76 message = {
76 "property": "fullnarp", 77 "property": "fullnarp",
77 "current_version": newest_version, 78 "current_version": newest_version,
78 "version_url": fullnarp_path + "versions/fullnarp_" + str(newest_version).zfill(5) + ".json", 79 "version_url": fullnarp_path
80 + "versions/fullnarp_"
81 + str(newest_version).zfill(5)
82 + ".json",
79 "data": current_version, 83 "data": current_version,
80 } 84 }
81 85
@@ -127,7 +131,10 @@ async def handle_client(websocket):
127 message = { 131 message = {
128 "property": "fullnarp", 132 "property": "fullnarp",
129 "current_version": newest_version, 133 "current_version": newest_version,
130 "version_url": fullnarp_path + "versions/fullnarp_" + str(newest_version).zfill(5) + ".json", 134 "version_url": fullnarp_path
135 + "versions/fullnarp_"
136 + str(newest_version).zfill(5)
137 + ".json",
131 "data": current_version, 138 "data": current_version,
132 } 139 }
133 await websocket.send(json.dumps(message)) 140 await websocket.send(json.dumps(message))
diff --git a/halfnarp2.py b/halfnarp2.py
index f13f967..314b1b4 100755
--- a/halfnarp2.py
+++ b/halfnarp2.py
@@ -271,7 +271,7 @@ if __name__ == "__main__":
271 app.config["SECRET_KEY"] = config.get("server-secret", "<YOUR SERVER SECRET HERE>") 271 app.config["SECRET_KEY"] = config.get("server-secret", "<YOUR SERVER SECRET HERE>")
272 272
273 if app.config["SECRET_KEY"] == "<YOUR SERVER SECRET HERE>": 273 if app.config["SECRET_KEY"] == "<YOUR SERVER SECRET HERE>":
274 print ("You must set the server-secret in your config.json") 274 print("You must set the server-secret in your config.json")
275 sys.exit(1) 275 sys.exit(1)
276 276
277 app.jinja_env.trim_blocks = True 277 app.jinja_env.trim_blocks = True