make Ruff happy
This commit is contained in:
@@ -78,7 +78,7 @@ async def handle_logging(response):
|
|||||||
else:
|
else:
|
||||||
origin = "client"
|
origin = "client"
|
||||||
|
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if request.path.startswith("/.well-known/matrix/"):
|
if request.path.startswith("/.well-known/matrix/"):
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import asyncio
|
|||||||
import random
|
import random
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from .groups import groups
|
||||||
|
|
||||||
from flask import (
|
from flask import (
|
||||||
Blueprint,
|
Blueprint,
|
||||||
jsonify,
|
jsonify,
|
||||||
@@ -15,8 +17,6 @@ from flask import (
|
|||||||
|
|
||||||
client = Blueprint("client", __name__)
|
client = Blueprint("client", __name__)
|
||||||
|
|
||||||
from .groups import groups
|
|
||||||
|
|
||||||
client.register_blueprint(groups)
|
client.register_blueprint(groups)
|
||||||
|
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ async def register():
|
|||||||
"device_id": "VVOONNAA"
|
"device_id": "VVOONNAA"
|
||||||
})
|
})
|
||||||
|
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return jsonify({
|
return jsonify({
|
||||||
@@ -342,7 +342,7 @@ async def sync():
|
|||||||
if "timeout" in request.args:
|
if "timeout" in request.args:
|
||||||
try:
|
try:
|
||||||
wait_time = int(request.args.get("timeout")) / 1000
|
wait_time = int(request.args.get("timeout")) / 1000
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
await asyncio.sleep(wait_time)
|
await asyncio.sleep(wait_time)
|
||||||
|
|
||||||
@@ -420,7 +420,7 @@ async def events():
|
|||||||
if "timeout" in request.args:
|
if "timeout" in request.args:
|
||||||
try:
|
try:
|
||||||
await asyncio.sleep(int(request.args["timeout"]) / 1000)
|
await asyncio.sleep(int(request.args["timeout"]) / 1000)
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return jsonify({
|
return jsonify({
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
import vona.config
|
import vona.config
|
||||||
|
str(vona.config.server_name) # Satisfy Ruff
|
||||||
|
|||||||
@@ -2,13 +2,6 @@ from flask import (
|
|||||||
Blueprint,
|
Blueprint,
|
||||||
)
|
)
|
||||||
|
|
||||||
custom = Blueprint("custom", __name__)
|
|
||||||
|
|
||||||
# This implements non-standard
|
|
||||||
# endpoints created by other
|
|
||||||
# homeserver implementations.
|
|
||||||
|
|
||||||
|
|
||||||
from .hammerhead import hammerhead
|
from .hammerhead import hammerhead
|
||||||
from .conduwuit import conduwuit
|
from .conduwuit import conduwuit
|
||||||
from .dendrite import dendrite
|
from .dendrite import dendrite
|
||||||
@@ -16,6 +9,13 @@ from .telodendria import telo
|
|||||||
from .synapse import synapse
|
from .synapse import synapse
|
||||||
from .citadel import citadel
|
from .citadel import citadel
|
||||||
|
|
||||||
|
custom = Blueprint("custom", __name__)
|
||||||
|
|
||||||
|
# This implements non-standard
|
||||||
|
# endpoints created by other
|
||||||
|
# homeserver implementations.
|
||||||
|
|
||||||
|
|
||||||
custom.register_blueprint(hammerhead)
|
custom.register_blueprint(hammerhead)
|
||||||
custom.register_blueprint(conduwuit)
|
custom.register_blueprint(conduwuit)
|
||||||
custom.register_blueprint(dendrite)
|
custom.register_blueprint(dendrite)
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ async def extremities(room):
|
|||||||
if room.split(":")[1] != config.server_name:
|
if room.split(":")[1] != config.server_name:
|
||||||
return jsonify({
|
return jsonify({
|
||||||
"errcode": "M_NOT_FOUND",
|
"errcode": "M_NOT_FOUND",
|
||||||
"error": f"Room is unknown to this server"
|
"error": "Room is unknown to this server"
|
||||||
}), 404
|
}), 404
|
||||||
|
|
||||||
room_ver = globals.room_version_from_id(room)
|
room_ver = globals.room_version_from_id(room)
|
||||||
@@ -420,7 +420,7 @@ async def state_ids(room):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
return jsonify(resp.json())
|
return jsonify(resp.json())
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return explode()
|
return explode()
|
||||||
|
|||||||
@@ -374,9 +374,9 @@ class http_client:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def strip_state(l) -> list:
|
def strip_state(state_events) -> list:
|
||||||
if not isinstance(l, list):
|
if not isinstance(state_events, list):
|
||||||
return l
|
return state_events
|
||||||
|
|
||||||
keys_to_remove = [
|
keys_to_remove = [
|
||||||
"auth_events",
|
"auth_events",
|
||||||
@@ -387,7 +387,7 @@ def strip_state(l) -> list:
|
|||||||
]
|
]
|
||||||
|
|
||||||
new_list = []
|
new_list = []
|
||||||
for d in l:
|
for d in state_events:
|
||||||
if not isinstance(d, dict):
|
if not isinstance(d, dict):
|
||||||
new_list.append(d)
|
new_list.append(d)
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import vona.globals as globals
|
import vona.globals as globals
|
||||||
import vona.config as config
|
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
|
|
||||||
versions = [str(i) for i in range(1, 10)]
|
versions = [str(i) for i in range(1, 10)]
|
||||||
@@ -19,7 +18,7 @@ def worker(room_found):
|
|||||||
print(room_id)
|
print(room_id)
|
||||||
room_found.value = True
|
room_found.value = True
|
||||||
break
|
break
|
||||||
except Exception as e:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user