mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
Removed test code from view
This commit is contained in:
parent
cbb6e381b9
commit
204faa1f52
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user