some cleanup
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2021-04-25 17:09:37 +02:00
parent 904c01db47
commit e3d1280cb6
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -5,22 +5,18 @@ from executor import Executor
class Server:
def __init__(self, homeDirectory: str = "", sessionTimeout: int = 120, availableServer: bool = True,
currentDirectory: str = ""):
def __init__(self, homeDirectory: str = "", sessionTimeout: int = 120, availableServer: bool = True):
self.isAuthenticated = False
self.homeDirectory = homeDirectory
self.sessionTimeout = sessionTimeout
self.availableServer = availableServer
if currentDirectory == "":
self.currentDirectory = homeDirectory
else:
self.currentDirectory = currentDirectory
self.executor = Executor(homeDirectory)
def login(self, username: str, password: str) -> bool:
auth = Authetication()
self.isAuthenticated = True
home_directory = auth.login(username, password)
self.executor.baseDir=Executor(home_directory)
if not home_directory:
return False
else:
@ -30,7 +26,7 @@ class Server:
self.isAuthenticated = False
self.availableServer = False
self.homeDirectory = ""
self.currentDirectory = ""
self.executor.baseDir=Executor(self.homeDirectory)
def parseCommand(self, command: str) -> str:
parsedCommand = command.split(" ")