clean up the code

This commit is contained in:
randomuser 2021-07-20 02:44:48 -05:00
parent c194b01731
commit 08588b967f
1 changed files with 4 additions and 4 deletions

View File

@ -42,6 +42,7 @@ class GopherLine:
try: self.port = split[3]
except IndexError:
if location == True: self.port = str(port)
def render(self):
return "{}{}\t{}\t{}\t{}".format(
self.item,
@ -97,10 +98,10 @@ class GopherServerLogic:
fd.close()
return ret
def sendFileArray(self, arr):
def sendFileArray(self, fileArray):
[self.request.sendall(
(i.rstrip() + "\r\n").encode("utf-8")
) for i in arr]
) for i in fileArray]
self.request.sendall(b".\r\n")
def cgi(self, file, query):
@ -143,8 +144,7 @@ class GopherServerLogic:
class GopherHandler(socketserver.BaseRequestHandler, GopherServerLogic):
def handle(self):
decoded = self.recieveRequest()
try:
parsed = self.requestParser(decoded)
try: parsed = self.requestParser(decoded)
except RequestError:
self.invalid()
return