clean up the code
This commit is contained in:
parent
c194b01731
commit
08588b967f
8
esgd.py
8
esgd.py
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue