This commit is contained in:
parent
c4333ed827
commit
034f1e3403
@ -51,7 +51,7 @@ class Server:
|
||||
if self.executor.baseDir == "":
|
||||
raise Exception("Home directory must not be empty string. Did the user log in?")
|
||||
if command == "LOUT":
|
||||
if secondParam != "" or firstParam != "":
|
||||
if not (secondParam == "" and firstParam == ""):
|
||||
self.networkInstance.sendMessage("ERROR".encode('UTF-8'))
|
||||
else:
|
||||
self.networkInstance.sendMessage("OK".encode('UTF-8'))
|
||||
@ -69,7 +69,7 @@ class Server:
|
||||
self.executor.removeDirectory(firstParam)
|
||||
self.networkInstance.sendMessage("OK".encode('UTF-8'))
|
||||
elif command == "GWD":
|
||||
if secondParam != "" or firstParam != "":
|
||||
if not (secondParam == "" and firstParam == ""):
|
||||
self.networkInstance.sendMessage("ERROR".encode('UTF-8'))
|
||||
else:
|
||||
self.networkInstance.sendMessage(self.executor.getCurrentDirectory().encode('UTF-8'))
|
||||
@ -80,7 +80,7 @@ class Server:
|
||||
self.executor.setCurrentDirectory(firstParam)
|
||||
self.networkInstance.sendMessage("OK".encode('UTF-8'))
|
||||
elif command == "LST":
|
||||
if secondParam != "" or firstParam != "":
|
||||
if not (secondParam == "" and firstParam == ""):
|
||||
self.networkInstance.sendMessage("ERROR".encode('UTF-8'))
|
||||
else:
|
||||
self.networkInstance.sendMessage(self.executor.listCurrentDirectoryContent().encode('UTF-8'))
|
||||
@ -109,7 +109,7 @@ class Server:
|
||||
file = self.executor.getFileInCurrentDirectory(firstParam)
|
||||
self.networkInstance.sendMessage(file)
|
||||
self.networkInstance.sendMessage("EOF".encode('UTF-8'))
|
||||
except:
|
||||
except Exception:
|
||||
self.networkInstance.sendMessage("ERROR".encode('UTF-8'))
|
||||
else:
|
||||
self.networkInstance.sendMessage("ERROR".encode('UTF-8'))
|
||||
|
Loading…
Reference in New Issue
Block a user