Ran black on sources
This commit is contained in:
parent
24d52f229f
commit
f6b43b0416
125 changed files with 355 additions and 329 deletions
|
|
@ -353,9 +353,9 @@ class DiscordClient(WebSocketClientProtocol, _BASE_SESSION_CLASS):
|
|||
url = f"{DISCORD_API_BASE_URL}/{url}"
|
||||
body = FileBodyProducer(BytesIO(json.dumps(data).encode("utf-8")))
|
||||
request_type = kwargs.pop("type", "POST")
|
||||
|
||||
|
||||
d = _AGENT.request(
|
||||
request_type.encode("utf-8"),
|
||||
request_type.encode("utf-8"),
|
||||
url.encode("utf-8"),
|
||||
Headers(
|
||||
{
|
||||
|
|
@ -501,7 +501,6 @@ class DiscordClient(WebSocketClientProtocol, _BASE_SESSION_CLASS):
|
|||
self._post_json(f"guilds/{guild_id}/members/{user_id}", data, type="PATCH")
|
||||
|
||||
def send_role(self, role_id, guild_id, user_id, **kwargs):
|
||||
|
||||
data = kwargs
|
||||
self._post_json(f"guilds/{guild_id}/members/{user_id}/roles/{role_id}", data, type="PUT")
|
||||
|
||||
|
|
@ -570,4 +569,4 @@ class DiscordClient(WebSocketClientProtocol, _BASE_SESSION_CLASS):
|
|||
# send the data for any other action types on to the bot as-is for optional server-side handling
|
||||
keywords = {"type": action_type}
|
||||
keywords.update(data["d"])
|
||||
self.sessionhandler.data_in(self, bot_data_in=("", keywords))
|
||||
self.sessionhandler.data_in(self, bot_data_in=("", keywords))
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ class RestartingWebsocketServerFactory(WebSocketClientFactory, protocol.Reconnec
|
|||
maxDelay = 60
|
||||
|
||||
def __init__(self, sessionhandler, *args, **kwargs):
|
||||
|
||||
self.uid = kwargs.pop("uid")
|
||||
self.channel = kwargs.pop("grapevine_channel")
|
||||
self.sessionhandler = sessionhandler
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import evennia
|
|||
|
||||
evennia._init(portal_mode=True)
|
||||
from evennia.server.portal.portalsessionhandler import PORTAL_SESSIONS
|
||||
|
||||
from evennia.server.webserver import EvenniaReverseProxyResource
|
||||
from evennia.utils import logger
|
||||
from evennia.utils.utils import (
|
||||
|
|
@ -264,11 +263,9 @@ if "--nodaemon" not in sys.argv and "test" not in sys.argv:
|
|||
PORTAL = Portal(application)
|
||||
|
||||
if LOCKDOWN_MODE:
|
||||
|
||||
INFO_DICT["lockdown_mode"] = " LOCKDOWN_MODE active: Only local connections."
|
||||
|
||||
if AMP_ENABLED:
|
||||
|
||||
# The AMP protocol handles the communication between
|
||||
# the portal and the mud server. Only reason to ever deactivate
|
||||
# it would be during testing and debugging.
|
||||
|
|
@ -287,7 +284,6 @@ if AMP_ENABLED:
|
|||
# These will gradually be started as they are initialized below.
|
||||
|
||||
if TELNET_ENABLED:
|
||||
|
||||
# Start telnet game connections
|
||||
|
||||
from evennia.server.portal import telnet
|
||||
|
|
@ -312,7 +308,6 @@ if TELNET_ENABLED:
|
|||
|
||||
|
||||
if SSL_ENABLED:
|
||||
|
||||
# Start Telnet+SSL game connection (requires PyOpenSSL).
|
||||
|
||||
from evennia.server.portal import telnet_ssl
|
||||
|
|
@ -346,7 +341,6 @@ if SSL_ENABLED:
|
|||
|
||||
|
||||
if SSH_ENABLED:
|
||||
|
||||
# Start SSH game connections. Will create a keypair in
|
||||
# evennia/game if necessary.
|
||||
|
||||
|
|
|
|||
|
|
@ -342,7 +342,6 @@ class SshProtocol(Manhole, _BASE_SESSION_CLASS):
|
|||
|
||||
|
||||
class ExtraInfoAuthServer(SSHUserAuthServer):
|
||||
|
||||
noisy = False
|
||||
|
||||
def auth_password(self, packet):
|
||||
|
|
|
|||
|
|
@ -10,11 +10,6 @@ sessions etc.
|
|||
import re
|
||||
|
||||
from django.conf import settings
|
||||
from evennia.server.portal import mssp, naws, suppress_ga, telnet_oob, ttype
|
||||
from evennia.server.portal.mccp import MCCP, Mccp, mccp_compress
|
||||
from evennia.server.portal.mxp import Mxp, mxp_parse
|
||||
from evennia.utils import ansi
|
||||
from evennia.utils.utils import class_from_module, to_bytes
|
||||
from twisted.conch.telnet import (
|
||||
ECHO,
|
||||
GA,
|
||||
|
|
@ -33,6 +28,12 @@ from twisted.conch.telnet import (
|
|||
from twisted.internet import protocol
|
||||
from twisted.internet.task import LoopingCall
|
||||
|
||||
from evennia.server.portal import mssp, naws, suppress_ga, telnet_oob, ttype
|
||||
from evennia.server.portal.mccp import MCCP, Mccp, mccp_compress
|
||||
from evennia.server.portal.mxp import Mxp, mxp_parse
|
||||
from evennia.utils import ansi
|
||||
from evennia.utils.utils import class_from_module, to_bytes
|
||||
|
||||
_RE_N = re.compile(r"\|n$")
|
||||
_RE_LEND = re.compile(rb"\n$|\r$|\r\n$|\r\x00$|", re.MULTILINE)
|
||||
_RE_LINEBREAK = re.compile(rb"\n\r|\r\n|\n|\r", re.DOTALL + re.MULTILINE)
|
||||
|
|
|
|||
|
|
@ -103,7 +103,6 @@ def verify_or_create_SSL_key_and_cert(keyfile, certfile):
|
|||
return False
|
||||
|
||||
else:
|
||||
|
||||
try:
|
||||
# create certificate
|
||||
cert = crypto.X509()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue