aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/dump.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-07-13 18:45:50 +1200
committerAldo Cortesi <aldo@nullcube.com>2016-07-13 18:45:50 +1200
commita20f8e9620c0cfcb40500113cbeb813a05a195bb (patch)
tree896877f7efb697cdeea9498ba2a6a4e493497dfe /mitmproxy/dump.py
parent2624911d75670afaff8631943d567bfa2b42d7b8 (diff)
downloadmitmproxy-a20f8e9620c0cfcb40500113cbeb813a05a195bb.tar.gz
mitmproxy-a20f8e9620c0cfcb40500113cbeb813a05a195bb.tar.bz2
mitmproxy-a20f8e9620c0cfcb40500113cbeb813a05a195bb.zip
More powerful Options scheme
This prepares us for the addon configuration mechanism and gives us a more flexible way to handle options changes. This changeset should spell the end of the current anti-pattern in our codebase where we duplicate data out of options onto the master when mutability is needed. From now on, Options can be the one source of thruth. - Change notifications - Rollback on error
Diffstat (limited to 'mitmproxy/dump.py')
-rw-r--r--mitmproxy/dump.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/mitmproxy/dump.py b/mitmproxy/dump.py
index 10465b63..bfefb319 100644
--- a/mitmproxy/dump.py
+++ b/mitmproxy/dump.py
@@ -11,6 +11,7 @@ from mitmproxy import controller
from mitmproxy import exceptions
from mitmproxy import filt
from mitmproxy import flow
+from mitmproxy import options
from netlib import human
from netlib import tcp
from netlib import strutils
@@ -20,7 +21,7 @@ class DumpError(Exception):
pass
-class Options(object):
+class Options(options.Options):
attributes = [
"app",
"app_host",
@@ -53,13 +54,6 @@ class Options(object):
"replay_ignore_host"
]
- def __init__(self, **kwargs):
- for k, v in kwargs.items():
- setattr(self, k, v)
- for i in self.attributes:
- if not hasattr(self, i):
- setattr(self, i, None)
-
class DumpMaster(flow.FlowMaster):