Skip to content

Commit ccd85da

Browse files
committedJan 24, 2016
Remove list filename option
There's just not really a compelling reason for this to be configurable.
1 parent b366290 commit ccd85da

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed
 

‎config-example.py

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
# Port for development server to listen on
99
PORT = 5000
1010

11-
# File to store the JSON server list data in.
12-
FILENAME = "list.json"
13-
1411
# Amount of time, is seconds, after which servers are removed from the list
1512
# if they haven't updated their listings. Note: By default Minetest servers
1613
# only announce once every 5 minutes, so this should be more than 300.

‎server.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def index():
2626
def list():
2727
# We have to make sure that the list isn't cached,
2828
# since the list isn't really static.
29-
return send_from_directory(app.static_folder, app.config["FILENAME"],
29+
return send_from_directory(app.static_folder, "list.json",
3030
cache_timeout=0)
3131

3232

@@ -336,7 +336,7 @@ def purgeOld(self):
336336

337337
def load(self):
338338
try:
339-
with open(os.path.join("static", app.config["FILENAME"]), "r") as fd:
339+
with open(os.path.join("static", "list.json"), "r") as fd:
340340
data = json.load(fd)
341341
except FileNotFoundError:
342342
return
@@ -359,7 +359,7 @@ def save(self):
359359
self.maxServers = max(servers, self.maxServers)
360360
self.maxClients = max(clients, self.maxClients)
361361

362-
with open(os.path.join("static", app.config["FILENAME"]), "w") as fd:
362+
with open(os.path.join("static", "list.json"), "w") as fd:
363363
json.dump({
364364
"total": {"servers": servers, "clients": clients},
365365
"total_max": {"servers": self.maxServers, "clients": self.maxClients},

0 commit comments

Comments
 (0)
Please sign in to comment.