This commit is contained in:
parent
904c01db47
commit
e3d1280cb6
@ -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(" ")
|
||||
|
Loading…
Reference in New Issue
Block a user