Reformat and fix circular import

This commit is contained in:
2022-07-21 13:40:03 +01:00
parent 3229d9b806
commit 6c7d0d5c45
11 changed files with 52 additions and 29 deletions

View File

@@ -77,7 +77,9 @@ class Network:
# e.g. freenode1 for the first relay on freenode network
keyFN = main.certPath + main.config["Key"]
certFN = main.certPath + main.config["Certificate"]
contextFactory = DefaultOpenSSLContextFactory(keyFN.encode("utf-8", "replace"), certFN.encode("utf-8", "replace"))
contextFactory = DefaultOpenSSLContextFactory(
keyFN.encode("utf-8", "replace"), certFN.encode("utf-8", "replace")
)
bot = IRCBotFactory(self.net, num)
# host, port = self.relays[num]["host"], self.relays[num]["port"]
host, port = getRelay(num)

View File

@@ -1,11 +1,13 @@
import main
from core.bot import deliverRelayCommands
from utils.deliver_relay_commands import deliverRelayCommands
from utils.logging.log import *
from twisted.internet import reactor
import modules.regproc
def provisionUserNetworkData(num, nick, altnick, ident, realname, emails, network, host, port, security, auth, password):
def provisionUserNetworkData(
num, nick, altnick, ident, realname, emails, network, host, port, security, auth, password
):
print("nick", nick)
print("altnick", altnick)
print("emails", emails)

View File

@@ -5,6 +5,7 @@ from utils.logging.debug import *
from copy import deepcopy
from random import choice
def needToRegister(net):
# Check if the network does not support authentication
networkObj = main.network[net]
@@ -51,7 +52,7 @@ def substitute(net, num, token=None):
nickname = alias["nick"]
username = nickname + "/" + net
password = main.network[net].aliases[num]["password"]
#inst["email"] = inst["email"].replace("{nickname}", nickname)
# inst["email"] = inst["email"].replace("{nickname}", nickname)
for i in inst.keys():
if not isinstance(inst[i], str):
continue
@@ -129,10 +130,14 @@ def registerTest(c):
if not main.IRCPool[name]._negativePass == True:
if c["type"] == "query" and c["nick"] == sinst["entity"]:
if sinst["checknegativemsg"] in c["msg"]:
confirmRegistration(c["net"], c["num"], negativepass=False) # Not passed negative check, report back
confirmRegistration(
c["net"], c["num"], negativepass=False
) # Not passed negative check, report back
return
if sinst["checkendnegative"] in c["msg"]:
confirmRegistration(c["net"], c["num"], negativepass=True) # Passed the negative check, report back
confirmRegistration(
c["net"], c["num"], negativepass=True
) # Passed the negative check, report back
return
if sinst["ping"]:
if sinst["checkmsg2"] in c["msg"] and c["nick"] == sinst["entity"]: