diff options
-rw-r--r-- | libpathod/pathoc.py | 5 | ||||
-rw-r--r-- | libpathod/pathod.py | 12 | ||||
-rw-r--r-- | libpathod/test.py | 4 | ||||
-rw-r--r-- | libpathod/utils.py | 2 | ||||
-rw-r--r-- | requirements.txt | 2 |
5 files changed, 12 insertions, 13 deletions
diff --git a/libpathod/pathoc.py b/libpathod/pathoc.py index c926f15f..0769b43c 100644 --- a/libpathod/pathoc.py +++ b/libpathod/pathoc.py @@ -1,5 +1,4 @@ import sys, os -import json from netlib import tcp, http import netlib.utils import language, utils @@ -45,7 +44,7 @@ class Pathoc(tcp.TCPClient): parsed = http.parse_response_line(l) if not parsed[1] == 200: raise PathocError("Proxy CONNECT failed: %s - %s"%(parsed[1], parsed[2])) - headers = http.read_headers(self.rfile) + http.read_headers(self.rfile) def connect(self, connect_to=None): """ @@ -69,7 +68,7 @@ class Pathoc(tcp.TCPClient): language.FileAccessDenied. """ r = language.parse_request(self.settings, spec) - ret = language.serve(r, self.wfile, self.settings, self.host) + language.serve(r, self.wfile, self.settings, self.host) self.wfile.flush() return Response(*http.read_response(self.rfile, r.method, None)) diff --git a/libpathod/pathod.py b/libpathod/pathod.py index d925de24..93f7a8ae 100644 --- a/libpathod/pathod.py +++ b/libpathod/pathod.py @@ -1,5 +1,5 @@ -import urllib, threading, re, logging, socket, sys, base64 -from netlib import tcp, http, odict, wsgi, certutils +import urllib, threading, re, logging +from netlib import tcp, http, wsgi, certutils import netlib.utils import version, app, language, utils @@ -158,13 +158,13 @@ class PathodHandler(tcp.BaseHandler): cc = wsgi.ClientConn(self.client_address) req = wsgi.Request(cc, "http", method, path, headers, content) sn = self.connection.getsockname() - app = wsgi.WSGIAdaptor( + a = wsgi.WSGIAdaptor( self.server.app, sn[0], self.server.port, version.NAMEVERSION ) - app.serve(req, self.wfile) + a.serve(req, self.wfile) return True, None def _log_bytes(self, header, data, hexdump): @@ -257,7 +257,7 @@ class Pathod(tcp.TCPServer): except re.error: raise PathodError("Invalid regex in anchor: %s"%i[0]) try: - aresp = language.parse_response(self.request_settings, i[1]) + language.parse_response(self.request_settings, i[1]) except language.ParseException, v: raise PathodError("Invalid page spec in anchor: '%s', %s"%(i[1], str(v))) self.anchors.append((arex, i[1])) @@ -268,7 +268,7 @@ class Pathod(tcp.TCPServer): """ try: l = req.maximum_length(settings) - except language.FileAccessDenied, v: + except language.FileAccessDenied: return "File access denied." if self.sizelimit and l > self.sizelimit: return "Response too large." diff --git a/libpathod/test.py b/libpathod/test.py index 2456e211..cc858497 100644 --- a/libpathod/test.py +++ b/libpathod/test.py @@ -1,6 +1,6 @@ -import json, threading, Queue +import threading, Queue import requests -import pathod, utils +import pathod class Daemon: diff --git a/libpathod/utils.py b/libpathod/utils.py index 26e9427d..b5dc73c7 100644 --- a/libpathod/utils.py +++ b/libpathod/utils.py @@ -1,4 +1,4 @@ -import os, re +import os SIZE_UNITS = dict( b = 1024**0, diff --git a/requirements.txt b/requirements.txt index 73ed126b..8821e295 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,4 @@ nose>=1.3.0 pyOpenSSL>=0.13.1 pyasn1>=0.1.7 requests>=2.1.0 -netlib>=0.9.2
\ No newline at end of file +netlib>=0.10 |