move log assignment and friends to be in-scope
This commit is contained in:
parent
b3a665448a
commit
d35296ef16
8
esgd.py
8
esgd.py
|
@ -3,10 +3,6 @@ import subprocess
|
|||
import os
|
||||
import time
|
||||
|
||||
host = "localhost"
|
||||
port = 77
|
||||
log = Logger()
|
||||
|
||||
class GopherError(BaseException): pass
|
||||
class RequestError(GopherError): pass
|
||||
|
||||
|
@ -187,6 +183,10 @@ class GopherHandler(socketserver.BaseRequestHandler, GopherServerLogic):
|
|||
log.log("serving {}".format(file[0]))
|
||||
self.serveFile(file[0], parsed[1], file[1])
|
||||
|
||||
log = Logger()
|
||||
host = "localhost"
|
||||
port = 77
|
||||
|
||||
if __name__ == "__main__":
|
||||
with socketserver.TCPServer((host, port), GopherHandler) as server:
|
||||
server.serve_forever()
|
||||
|
|
Loading…
Reference in New Issue