Reformat project
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import main
|
||||
from modules import provision
|
||||
from utils.logging.log import *
|
||||
from utils.logging.debug import *
|
||||
from utils.logging.log import error
|
||||
from utils.logging.debug import debug
|
||||
from copy import deepcopy
|
||||
from random import choice
|
||||
|
||||
@@ -24,7 +24,7 @@ def selectInst(net):
|
||||
if net in main.irc.keys():
|
||||
inst = deepcopy(main.irc[net])
|
||||
for i in main.irc["_"].keys():
|
||||
if not i in inst:
|
||||
if i not in inst:
|
||||
inst[i] = main.irc["_"][i]
|
||||
else:
|
||||
inst = main.irc["_"]
|
||||
@@ -50,7 +50,7 @@ def substitute(net, num, token=None):
|
||||
error(f"Could not get email for {net} - {num}")
|
||||
return False
|
||||
nickname = alias["nick"]
|
||||
username = nickname + "/" + net
|
||||
# username = nickname + "/" + net
|
||||
password = main.network[net].aliases[num]["password"]
|
||||
# inst["email"] = inst["email"].replace("{nickname}", nickname)
|
||||
for i in inst.keys():
|
||||
@@ -88,7 +88,7 @@ def confirmRegistration(net, num, negativepass=None):
|
||||
obj = main.network[net]
|
||||
name = net + str(num)
|
||||
if name in main.IRCPool.keys():
|
||||
if not negativepass == None:
|
||||
if negativepass is not None:
|
||||
main.IRCPool[name].regPing(negativepass=negativepass)
|
||||
return
|
||||
debug("Relay authenticated: %s - %i" % (net, num))
|
||||
@@ -100,7 +100,7 @@ def confirmRegistration(net, num, negativepass=None):
|
||||
if main.IRCPool[name]._regAttempt:
|
||||
try:
|
||||
main.IRCPool[name]._regAttempt.cancel()
|
||||
except:
|
||||
except: # noqa
|
||||
pass
|
||||
obj.relays[num]["registered"] = True
|
||||
main.saveConf("network")
|
||||
@@ -112,22 +112,22 @@ def enableAuthentication(net, num):
|
||||
security = obj.security
|
||||
auth = obj.auth
|
||||
password = obj.aliases[num]["password"]
|
||||
uname = main.alias[num]["nick"] + "/" + net
|
||||
# uname = main.alias[num]["nick"] + "/" + net
|
||||
provision.provisionAuthenticationData(num, nick, net, security, auth, password) # Set up for auth
|
||||
main.IRCPool[net + str(num)].msg(main.config["Tweaks"]["ZNC"]["Prefix"] + "status", "Jump")
|
||||
if selectInst(net)["check"] == False:
|
||||
if selectInst(net)["check"] is False:
|
||||
confirmRegistration(net, num)
|
||||
|
||||
|
||||
def registerTest(c):
|
||||
sinst = substitute(c["net"], c["num"])
|
||||
name = c["net"] + str(c["num"])
|
||||
if sinst["check"] == False:
|
||||
if sinst["check"] is False:
|
||||
return
|
||||
if "msg" in c.keys() and not c["msg"] == None:
|
||||
if "msg" in c.keys() and not c["msg"] is None:
|
||||
if sinst["negative"]:
|
||||
if name in main.IRCPool.keys():
|
||||
if not main.IRCPool[name]._negativePass == True:
|
||||
if main.IRCPool[name]._negativePass is not True:
|
||||
if c["type"] == "query" and c["nick"] == sinst["entity"]:
|
||||
if sinst["checknegativemsg"] in c["msg"]:
|
||||
confirmRegistration(
|
||||
@@ -150,6 +150,6 @@ def registerTest(c):
|
||||
elif sinst["checktype"] == "mode":
|
||||
if c["type"] == "self":
|
||||
if c["mtype"] == "mode":
|
||||
if sinst["checkmode"] in c["mode"] and c["status"] == True:
|
||||
if sinst["checkmode"] in c["mode"] and c["status"] is True:
|
||||
confirmRegistration(c["net"], c["num"])
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user