Reformat code with pre-commit

This commit is contained in:
2022-07-21 13:39:41 +01:00
parent 0777a55264
commit ff1ee63900
60 changed files with 547 additions and 278 deletions

View File

@@ -5,7 +5,25 @@ from copy import deepcopy
import main
from utils.logging.log import *
validTypes = ["msg", "notice", "action", "who", "part", "join", "kick", "quit", "nick", "topic", "mode", "conn", "znc", "query", "self", "highlight"]
validTypes = [
"msg",
"notice",
"action",
"who",
"part",
"join",
"kick",
"quit",
"nick",
"topic",
"mode",
"conn",
"znc",
"query",
"self",
"highlight",
]
class Relay(Protocol):
def __init__(self, addr):
@@ -108,7 +126,7 @@ class Relay(Protocol):
def connectionMade(self):
log("Relay connection from %s:%s" % (self.addr.host, self.addr.port))
#self.send("Greetings.")
# self.send("Greetings.")
def connectionLost(self, reason):
self.authed = False
@@ -118,6 +136,7 @@ class Relay(Protocol):
else:
warn("Tried to remove a non-existant relay connection.")
class RelayFactory(Factory):
def buildProtocol(self, addr):
entry = Relay(addr)
@@ -131,6 +150,7 @@ class RelayFactory(Factory):
else:
return
def sendRelayNotification(cast):
for i in main.relayConnections.keys():
if main.relayConnections[i].authed: