comment pszeudoprogramming meme
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c5d89d8b13
commit
c091532f74
@ -101,13 +101,13 @@ class NetWrapper:
|
|||||||
self.keyExchange()
|
self.keyExchange()
|
||||||
success = self.login()
|
success = self.login()
|
||||||
if success:
|
if success:
|
||||||
return b"LINOK"
|
return "LINOK".encode('UTF-8')
|
||||||
else:
|
else:
|
||||||
self.logout()
|
self.logout()
|
||||||
return b"LINERROR"
|
return "LINERROR".encode('UTF-8')
|
||||||
except Exception:
|
except Exception:
|
||||||
self.logout()
|
self.logout()
|
||||||
return b"LINERROR"
|
return "LINERROR".encode('UTF-8')
|
||||||
|
|
||||||
def recieveMessage(self) -> bytes:
|
def recieveMessage(self) -> bytes:
|
||||||
status, msg = self.network.receive_msg(blocking=True)
|
status, msg = self.network.receive_msg(blocking=True)
|
||||||
|
@ -31,6 +31,10 @@ class Server:
|
|||||||
self.executor.baseDir=Executor(self.homeDirectory)
|
self.executor.baseDir=Executor(self.homeDirectory)
|
||||||
|
|
||||||
def parseCommand(self, command: str) -> str:
|
def parseCommand(self, command: str) -> str:
|
||||||
|
if command == "LINOK":
|
||||||
|
return "LINOK"
|
||||||
|
elif command == "LINERROR":
|
||||||
|
return "LINERROR"
|
||||||
parsedCommand = command.split(" ")
|
parsedCommand = command.split(" ")
|
||||||
if len(parsedCommand) > 3:
|
if len(parsedCommand) > 3:
|
||||||
return "ERROR"
|
return "ERROR"
|
||||||
@ -80,18 +84,25 @@ class Server:
|
|||||||
return "ERROR"
|
return "ERROR"
|
||||||
else:
|
else:
|
||||||
# TODO
|
# TODO
|
||||||
|
# Megkapod a filenevet argumentumneknt
|
||||||
|
# Fogadni kell egy uzenetet, ami a fajl tartalma
|
||||||
|
# Fogadni kell egy uzenetet, ami "EOF"
|
||||||
|
# Mindig minden legyen UTF-8-kent kodolva, kiveve a falj, az marard
|
||||||
pass
|
pass
|
||||||
elif command == "DNL":
|
elif command == "DNL":
|
||||||
if secondParam != "":
|
if secondParam != "":
|
||||||
return "ERROR"
|
return "ERROR"
|
||||||
else:
|
else:
|
||||||
# TODO
|
# TODO
|
||||||
|
# Megkapod a filenevet arguemntumkent
|
||||||
|
# Kuldeni kell egy uzenetet, ami a falj tartalma
|
||||||
|
# Kuldeni kell egy uzenetet, ami EOF
|
||||||
|
# Mindig minden legyen UTF-8-kent kodolva, kiveve a falj, az marard
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
return "ERROR"
|
return "ERROR"
|
||||||
|
|
||||||
def startServer(self):
|
def startServer(self):
|
||||||
while (True):
|
while True:
|
||||||
self.networkInstance.recieveMessage()
|
message = self.networkInstance.recieveMessage().decode('UTF-8')
|
||||||
|
self.parseCommand(message)
|
||||||
startServer()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user