From e3d1280cb63b32febaa2fcee5c1487f26de085d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Sun, 25 Apr 2021 17:09:37 +0200 Subject: [PATCH] some cleanup --- server/server.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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(" ")