aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libpathod/app.py4
-rw-r--r--libpathod/cmdline.py4
-rw-r--r--libpathod/pathod.py6
-rw-r--r--test/tutils.py3
4 files changed, 11 insertions, 6 deletions
diff --git a/libpathod/app.py b/libpathod/app.py
index c3ce9991..10f7c148 100644
--- a/libpathod/app.py
+++ b/libpathod/app.py
@@ -9,9 +9,9 @@ from netlib import http_uastrings
logging.basicConfig(level="DEBUG")
-def make_app(noapi):
+def make_app(noapi, debug):
app = Flask(__name__)
- # app.debug = True
+ app.debug = debug
if not noapi:
@app.route('/api/info')
diff --git a/libpathod/cmdline.py b/libpathod/cmdline.py
index bd6a4360..fb6a45e6 100644
--- a/libpathod/cmdline.py
+++ b/libpathod/cmdline.py
@@ -273,6 +273,10 @@ def args_pathod(argv, stdout=sys.stdout, stderr=sys.stderr):
"--nocraft", dest='nocraft', default=False, action="store_true",
help='Disable response crafting. If anchors are specified, they still work.'
)
+ parser.add_argument(
+ "--webdebug", dest='webdebug', default=False, action="store_true",
+ help='Debugging mode for the web app (dev only).'
+ )
group = parser.add_argument_group(
'SSL',
diff --git a/libpathod/pathod.py b/libpathod/pathod.py
index 0c626777..7b3f74d1 100644
--- a/libpathod/pathod.py
+++ b/libpathod/pathod.py
@@ -289,7 +289,8 @@ class Pathod(tcp.TCPServer):
logreq=False,
logresp=False,
explain=False,
- hexdump=False
+ hexdump=False,
+ webdebug=False,
):
"""
addr: (address, port) tuple. If port is 0, a free port will be
@@ -317,7 +318,7 @@ class Pathod(tcp.TCPServer):
self.logresp, self.hexdump = logresp, hexdump
self.explain = explain
- self.app = app.make_app(noapi)
+ self.app = app.make_app(noapi, webdebug)
self.app.config["pathod"] = self
self.log = []
self.logid = 0
@@ -438,6 +439,7 @@ def main(args): # pragma: nocover
logresp = args.logresp,
hexdump = args.hexdump,
explain = args.explain,
+ webdebug = args.webdebug
)
except PathodError, v:
print >> sys.stderr, "Error: %s"%v
diff --git a/test/tutils.py b/test/tutils.py
index 18b5fb78..4c29f5b2 100644
--- a/test/tutils.py
+++ b/test/tutils.py
@@ -29,7 +29,7 @@ class DaemonTests(object):
],
ssl = klass.ssl,
ssloptions = so,
- sizelimit=1*1024*1024,
+ sizelimit = 1*1024*1024,
noweb = klass.noweb,
noapi = klass.noapi,
nohang = klass.nohang,
@@ -74,7 +74,6 @@ class DaemonTests(object):
return c.request(spec)
-
@contextmanager
def tmpdir(*args, **kwargs):
orig_workdir = os.getcwd()