diff options
author | Pietro Francesco Tirenna <pietrotirenna.pt@gmail.com> | 2018-06-30 15:52:48 +0200 |
---|---|---|
committer | Pietro Francesco Tirenna <pietrotirenna.pt@gmail.com> | 2018-06-30 15:52:48 +0200 |
commit | 204faa1f524cdd5dcd997237b017ffa045aad1ec (patch) | |
tree | 8a811cbd13622274a548e0626e553c6ecd8db6e0 | |
parent | cbb6e381b96e74d34de08e152d864b62b55b0176 (diff) | |
download | mitmproxy-204faa1f524cdd5dcd997237b017ffa045aad1ec.tar.gz mitmproxy-204faa1f524cdd5dcd997237b017ffa045aad1ec.tar.bz2 mitmproxy-204faa1f524cdd5dcd997237b017ffa045aad1ec.zip |
Removed test code from view
-rw-r--r-- | mitmproxy/addons/view.py | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/mitmproxy/addons/view.py b/mitmproxy/addons/view.py index 57aa4b31..1c8bd0ce 100644 --- a/mitmproxy/addons/view.py +++ b/mitmproxy/addons/view.py @@ -447,19 +447,12 @@ class View(collections.Sequence): Load flows into the view, without processing them with addons. """ try: - if path.endswith(".sqlite"): - dh = io.DbHandler(path) - for f in dh.load(): - self.add([f.copy()]) - else: - with open(path, "rb") as f: - for i in io.FlowReader(f).stream(): - # Do this to get a new ID, so we can load the same file N times and - # get new flows each time. It would be more efficient to just have a - # .newid() method or something. - self.add([i.copy()]) - except exceptions.TypeError as e: - ctx.log.error(str(e)) + with open(path, "rb") as f: + for i in io.FlowReader(f).stream(): + # Do this to get a new ID, so we can load the same file N times and + # get new flows each time. It would be more efficient to just have a + # .newid() method or something. + self.add([i.copy()]) except IOError as e: ctx.log.error(e.strerror) except exceptions.FlowReadException as e: |