diff --git a/server/server.py b/server/server.py index 089251f..5e3e13c 100644 --- a/server/server.py +++ b/server/server.py @@ -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(" ")