fix circular dependency
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -18,7 +18,7 @@ class Server:
|
||||
passphrase = input()
|
||||
self.auth = Authetication()
|
||||
self.networkInstance = NetWrapper(self.auth.loadUserPublicKeys(), self.auth.loadServerPrivateKey(passphrase),
|
||||
self)
|
||||
self.auth)
|
||||
|
||||
def login(self, username: str, password: str) -> bool:
|
||||
self.isAuthenticated = True
|
||||
@@ -30,6 +30,7 @@ class Server:
|
||||
return True
|
||||
|
||||
def logout(self) -> None:
|
||||
self.networkInstance.logout()
|
||||
self.isAuthenticated = False
|
||||
self.availableServer = False
|
||||
self.homeDirectory = ""
|
||||
@@ -56,7 +57,13 @@ class Server:
|
||||
def execute(self, command: str, firstParam: str = "", secondParam: str = "") -> None:
|
||||
if self.homeDirectory == "" or self.executor.currentDirectory == "" or self.executor.baseDir == "":
|
||||
raise Exception("Directories must not be empty string. Did the user log in?")
|
||||
if command == "MKD":
|
||||
if command == "LOUT":
|
||||
if secondParam != "" or firstParam != "":
|
||||
self.networkInstance.sendMessage("ERROR".encode('UTF-8'))
|
||||
else:
|
||||
self.logout()
|
||||
self.networkInstance.sendMessage("OK".encode('UTF-8'))
|
||||
elif command == "MKD":
|
||||
if secondParam != "":
|
||||
self.networkInstance.sendMessage("ERROR".encode('UTF-8'))
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user