You've already forked snikket-web-portal
Make flake8 happy
This commit is contained in:
@@ -9,7 +9,7 @@ from datetime import datetime, timedelta
|
||||
import quart.flask_patch
|
||||
|
||||
from quart import (
|
||||
Quart, session, request, render_template, redirect, url_for, Response,
|
||||
Quart, request, render_template, redirect, url_for, Response,
|
||||
current_app,
|
||||
)
|
||||
import quart.exceptions
|
||||
@@ -21,7 +21,7 @@ from flask_babel import Babel, _, lazy_gettext as _l
|
||||
from . import colour, xmpputil
|
||||
from .prosodyclient import client
|
||||
|
||||
from ._version import version, version_info
|
||||
from ._version import version, version_info # noqa:F401
|
||||
|
||||
app = Quart(__name__)
|
||||
app.config.setdefault("LANGUAGES", ["de", "en"])
|
||||
@@ -145,8 +145,12 @@ def proc():
|
||||
def url_for_avatar(entity, hash_, **kwargs):
|
||||
return url_for(
|
||||
"avatar",
|
||||
from_=base64.urlsafe_b64encode(entity.encode("utf-8")).decode("ascii").rstrip("="),
|
||||
code=base64.urlsafe_b64encode(binascii.a2b_hex(hash_)[:8]).decode("ascii").rstrip("="),
|
||||
from_=base64.urlsafe_b64encode(
|
||||
entity.encode("utf-8"),
|
||||
).decode("ascii").rstrip("="),
|
||||
code=base64.urlsafe_b64encode(
|
||||
binascii.a2b_hex(hash_)[:8],
|
||||
).decode("ascii").rstrip("="),
|
||||
**kwargs
|
||||
)
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import binascii
|
||||
import contextlib
|
||||
import functools
|
||||
import hashlib
|
||||
import json
|
||||
import logging
|
||||
import secrets
|
||||
|
||||
@@ -362,7 +359,7 @@ class ProsodyClient:
|
||||
self.session_address,
|
||||
current_password,
|
||||
)
|
||||
reply = await self._xml_iq_call(
|
||||
await self._xml_iq_call(
|
||||
session,
|
||||
xmpputil.make_password_change_request(
|
||||
self.session_address,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import base64
|
||||
import binascii
|
||||
import typing
|
||||
|
||||
import xml.etree.ElementTree as ET
|
||||
@@ -11,7 +10,8 @@ import quart.exceptions
|
||||
TAG_XMPP_ERROR = "error"
|
||||
|
||||
NS_XMPP_ERROR_CONDITION = "urn:ietf:params:xml:ns:xmpp-stanzas"
|
||||
TAG_XMPP_ERROR_ITEM_NOT_FOUND = "{{{}}}item-not-found".format(NS_XMPP_ERROR_CONDITION)
|
||||
TAG_XMPP_ERROR_ITEM_NOT_FOUND = \
|
||||
"{{{}}}item-not-found".format(NS_XMPP_ERROR_CONDITION)
|
||||
TAG_XMPP_ERROR_TEXT = "{{{}}}text".format(NS_XMPP_ERROR_CONDITION)
|
||||
|
||||
ERROR_CODE_MAP = {
|
||||
|
||||
Reference in New Issue
Block a user