Revert "Reformat project"

This reverts commit 64e3e1160aa76d191740342ab3edc68807f890fb.
This commit is contained in:
2022-07-21 13:40:01 +01:00
parent da678617d8
commit 27cafa1def
57 changed files with 214 additions and 519 deletions

View File

@@ -1,24 +1,18 @@
from yaml import dump
import main
from yaml import dump
class RelayCommand:
def __init__(self, *args):
self.relay(*args)
def relay(
self, addr, authed, data, obj, spl, success, failure, info, incUsage, length
):
def relay(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
if authed:
if length == 3:
if spl[1] == "add":
if spl[2] in main.network.keys():
id, alias = main.network[spl[2]].add_relay()
success(
"Successfully created relay %s on network %s with alias %s"
% (str(id), spl[2], alias)
)
success("Successfully created relay %s on network %s with alias %s" % (str(id), spl[2], alias))
main.saveConf("network")
return
else:
@@ -41,10 +35,7 @@ class RelayCommand:
failure("Must be a number, not %s" % spl[3])
return
id, alias = main.network[spl[2]].add_relay(int(spl[3]))
success(
"Successfully created relay %s on network %s with alias %s"
% (str(id), spl[2], alias)
)
success("Successfully created relay %s on network %s with alias %s" % (str(id), spl[2], alias))
main.saveConf("network")
return
else:
@@ -61,9 +52,7 @@ class RelayCommand:
failure("No such relay: %s on network %s" % (spl[3], spl[2]))
return
main.network[spl[2]].delete_relay(int(spl[3]))
success(
"Successfully deleted relay %s on network %s" % (spl[3], spl[2])
)
success("Successfully deleted relay %s on network %s" % (spl[3], spl[2]))
main.saveConf("network")
return
else: