Reformat project

This commit is contained in:
2022-07-21 13:40:05 +01:00
parent 4ecb37b179
commit 2fecd98978
44 changed files with 363 additions and 236 deletions

View File

@@ -10,33 +10,38 @@ from signal import signal, SIGINT
from sys import stdout, stderr # Import again because we want to override
from codecs import getwriter # fix printing odd shit to the terminal
stdout = getwriter("utf8")(stdout) # this is a generic fix but we all know
stderr = getwriter("utf8")(stderr) # it's just for the retards on Rizon using
# unicode quit messages for no reason
import main
main.initMain()
from utils.cleanup import handler
signal(SIGINT, handler) # Handle Ctrl-C and run the cleanup routine
from utils.logging.log import log
from utils.loaders.command_loader import loadCommands
from core.server import ServerFactory
from core.relay import RelayFactory
import modules.counters
import core.logstash
main.initMain()
if "--debug" in sys.argv: # yes really
main.config["Debug"] = True
if "--trace" in sys.argv:
main.config["Trace"] = True
from utils.logging.log import *
from utils.loaders.command_loader import loadCommands
from core.server import Server, ServerFactory
from core.relay import Relay, RelayFactory
import modules.counters
loadCommands()
import core.logstash
core.logstash.init_logstash()
signal(SIGINT, handler) # Handle Ctrl-C and run the cleanup routine
stdout = getwriter("utf8")(stdout) # this is a generic fix but we all know
stderr = getwriter("utf8")(stderr) # it's just for the retards on Rizon using
# unicode quit messages for no reason
if __name__ == "__main__":
listener = ServerFactory()
if main.config["Listener"]["UseSSL"] == True:
if main.config["Listener"]["UseSSL"] is True:
reactor.listenSSL(
main.config["Listener"]["Port"],
listener,
@@ -59,7 +64,7 @@ if __name__ == "__main__":
log("Threshold running on %s:%s" % (main.config["Listener"]["Address"], main.config["Listener"]["Port"]))
if main.config["RelayAPI"]["Enabled"]:
relay = RelayFactory()
if main.config["RelayAPI"]["UseSSL"] == True:
if main.config["RelayAPI"]["UseSSL"] is True:
reactor.listenSSL(
main.config["RelayAPI"]["Port"],
relay,