Merge branch 'master' of https://git.kmlabz.com/BiztProtoBois/server
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:
commit
ccc664e0ea
@ -72,11 +72,14 @@ class Executor:
|
|||||||
f.close()
|
f.close()
|
||||||
return currenctfile
|
return currenctfile
|
||||||
|
|
||||||
def getFileInCurrentDirectory(self, file: str):
|
def getFileInCurrentDirectory(self, file: str) -> bytes:
|
||||||
file = self.sanitizeFile(file)
|
file = self.sanitizeFile(file)
|
||||||
currentfile = os.path.join(self.currentDirectory, file)
|
currentfile = os.path.join(self.currentDirectory, file)
|
||||||
if os.path.exists(currentfile):
|
if os.path.exists(currentfile):
|
||||||
return open(currentfile, "r")
|
f = open(currentfile, "rb")
|
||||||
|
content = f.read()
|
||||||
|
f.close()
|
||||||
|
return content
|
||||||
else:
|
else:
|
||||||
raise Exception('File not found')
|
raise Exception('File not found')
|
||||||
|
|
||||||
|
@ -140,3 +140,4 @@ class NetWrapper:
|
|||||||
return plaintext
|
return plaintext
|
||||||
except Exception:
|
except Exception:
|
||||||
print("Incorrect decryption")
|
print("Incorrect decryption")
|
||||||
|
return "ERROR".encode('UTF-8')
|
||||||
|
@ -40,6 +40,8 @@ class Server:
|
|||||||
self.networkInstance.sendMessage("LINOK".encode('UTF-8'))
|
self.networkInstance.sendMessage("LINOK".encode('UTF-8'))
|
||||||
elif command == "LINERROR":
|
elif command == "LINERROR":
|
||||||
self.networkInstance.sendMessage("LINERROR".encode('UTF-8'))
|
self.networkInstance.sendMessage("LINERROR".encode('UTF-8'))
|
||||||
|
elif command == "ERROR":
|
||||||
|
return None
|
||||||
parsedCommand = command.split(" ")
|
parsedCommand = command.split(" ")
|
||||||
if len(parsedCommand) > 3:
|
if len(parsedCommand) > 3:
|
||||||
self.networkInstance.sendMessage("ERROR".encode('UTF-8'))
|
self.networkInstance.sendMessage("ERROR".encode('UTF-8'))
|
||||||
|
Loading…
Reference in New Issue
Block a user