Reformat legacy project

This commit is contained in:
2022-09-05 07:20:30 +01:00
parent 6b082adeb2
commit 8b9ad05089
59 changed files with 538 additions and 198 deletions

View File

@@ -1,16 +1,17 @@
from string import digits
from yaml import dump
import main
from modules.network import Network
from yaml import dump
class NetworkCommand:
def __init__(self, *args):
self.network(*args)
def network(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
def network(
self, addr, authed, data, obj, spl, success, failure, info, incUsage, length
):
if authed:
if length == 7:
if spl[1] == "add":
@@ -30,7 +31,9 @@ class NetworkCommand:
failure("Auth must be sasl, ns or none, not %s" % spl[5])
return
else:
main.network[spl[2]] = Network(spl[2], spl[3], int(spl[4]), spl[5].lower(), spl[6].lower())
main.network[spl[2]] = Network(
spl[2], spl[3], int(spl[4]), spl[5].lower(), spl[6].lower()
)
success("Successfully created network: %s" % spl[2])
main.saveConf("network")
return