squashed commit of many breaking changes

Dropping Support for Python 3.7; adding support for Python 3.9
This commit is contained in:
Fabian Dill
2020-10-19 08:26:31 +02:00
parent add0762114
commit 4f8c737eec
16 changed files with 149 additions and 150 deletions

View File

@@ -20,7 +20,7 @@ def download_patch(room_id, patch_id):
patch_data = update_patch_data(patch.data, server="berserkermulti.world:" + str(last_port))
patch_data = io.BytesIO(patch_data)
fname = f"P{patch.player}_{pname}_{app.jinja_env.filters['suuid'](room_id)}.bmbp"
fname = f"P{patch.player}_{pname}_{app.jinja_env.filters['suuid'](room_id)}.apbp"
return send_file(patch_data, as_attachment=True, attachment_filename=fname)
@@ -43,5 +43,5 @@ def download_raw_patch(seed_id, player_id):
patch_data = update_patch_data(patch.data, server="")
patch_data = io.BytesIO(patch_data)
fname = f"P{patch.player}_{pname}_{app.jinja_env.filters['suuid'](seed_id)}.bmbp"
fname = f"P{patch.player}_{pname}_{app.jinja_env.filters['suuid'](seed_id)}.apbp"
return send_file(patch_data, as_attachment=True, attachment_filename=fname)

View File

@@ -123,7 +123,7 @@ def upload_to_db(folder, owner, sid):
multidata = None
for file in os.listdir(folder):
file = os.path.join(folder, file)
if file.endswith(".bmbp"):
if file.endswith(".apbp"):
player = int(file.split("P")[1].split(".")[0].split("_")[0])
patches.add(Patch(data=open(file, "rb").read(), player=player))
elif file.endswith(".txt"):

View File

@@ -8,7 +8,7 @@ from pony.orm import commit, select
from WebHostLib import app, Seed, Room, Patch
accepted_zip_contents = {"patches": ".bmbp",
accepted_zip_contents = {"patches": ".apbp",
"spoiler": ".txt",
"multidata": "multidata"}
@@ -38,7 +38,7 @@ def uploads():
for file in infolist:
if file.filename.endswith(banned_zip_contents):
return "Uploaded data contained a rom file, which is likely to contain copyrighted material. Your file was deleted."
elif file.filename.endswith(".bmbp"):
elif file.filename.endswith(".apbp"):
player = int(file.filename.split("P")[1].split(".")[0].split("_")[0])
patches.add(Patch(data=zfile.open(file, "r").read(), player=player))
elif file.filename.endswith(".txt"):