diff options
author | Aldo Cortesi <aldo@corte.si> | 2016-06-14 15:25:01 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-14 15:25:01 +1200 |
commit | d8ae2f156203a81a8e6d325f5c460c351cfbfc5c (patch) | |
tree | 8b5e8ef981b6f691dcbbd504883714cb2f6fc182 /examples/har_extractor.py | |
parent | ccf4723505935f759c1bff5c5cc7d6d986726422 (diff) | |
parent | c2b5a13e3f1cfd193184c2fca9df0d531501a8ab (diff) | |
download | mitmproxy-d8ae2f156203a81a8e6d325f5c460c351cfbfc5c.tar.gz mitmproxy-d8ae2f156203a81a8e6d325f5c460c351cfbfc5c.tar.bz2 mitmproxy-d8ae2f156203a81a8e6d325f5c460c351cfbfc5c.zip |
Merge pull request #1254 from mitmproxy/scriptargs
Inline Scripts: use sys.argv instead of args argument.
Diffstat (limited to 'examples/har_extractor.py')
-rw-r--r-- | examples/har_extractor.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/har_extractor.py b/examples/har_extractor.py index 6806989d..c21f1a8f 100644 --- a/examples/har_extractor.py +++ b/examples/har_extractor.py @@ -3,6 +3,7 @@ https://github.com/JustusW/harparser to generate a HAR log object. """ import six +import sys from harparser import HAR from datetime import datetime @@ -52,15 +53,15 @@ class _HARLog(HAR.log): return self.__page_list__ -def start(context, argv): +def start(context): """ On start we create a HARLog instance. You will have to adapt this to suit your actual needs of HAR generation. As it will probably be necessary to cluster logs by IPs or reset them from time to time. """ context.dump_file = None - if len(argv) > 1: - context.dump_file = argv[1] + if len(sys.argv) > 1: + context.dump_file = sys.argv[1] else: raise ValueError( 'Usage: -s "har_extractor.py filename" ' |