Rework data structures, storing all front-end network data in Network objects

This commit is contained in:
Al Beano
2019-08-11 21:58:14 +01:00
parent f6657cb905
commit e5adcfef4c
24 changed files with 258 additions and 284 deletions

View File

@@ -1,5 +1,6 @@
import main
from yaml import dump
from modules.network import Network
class NetworkCommand:
def __init__(self, *args):
@@ -22,10 +23,7 @@ class NetworkCommand:
failure("Auth must be sasl, ns or none, not %s" % spl[5])
return
else:
main.network[spl[2]] = {"host": spl[3],
"port": spl[4],
"security": spl[5].lower(),
"auth": spl[6].lower()}
main.network[spl[2]] = Network(spl[2], spl[3], spl[4], spl[5].lower(), spl[6].lower())
success("Successfully created network: %s" % spl[2])
main.saveConf("network")
return