Skip to content

Commit

Permalink
Drop support for Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
vfaronov committed Jan 14, 2017
1 parent 370b5a9 commit afaacea
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: python

python:
- "2.7"
- "3.5"
- "3.6"

Expand Down
16 changes: 8 additions & 8 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ __ https://github.com/vfaronov/mitmproxy-httpolice/blob/master/CHANGELOG.rst
Installation
------------

::
Do this in a Python 3.5+ environment::

$ pip install mitmproxy-HTTPolice
$ pip3 install mitmproxy-HTTPolice

If this is giving you trouble,
see `mitmproxy docs`__ and `HTTPolice docs`__ for more detailed instructions.
Expand All @@ -46,19 +46,19 @@ Usage
-----
To run HTTPolice together with mitmproxy, use a command like this::

$ mitmdump -s "`python -m mitmproxy_httpolice` -o html report.html"
$ mitmdump -s "`python3 -m mitmproxy_httpolice` -o html report.html"

Note the backticks.
Also, you can replace ``mitmdump`` with ``mitmproxy`` if you wish.

``-s`` is an option for mitmproxy that specifies an inline script to run,
along with arguments to that script.

``python -m mitmproxy_httpolice`` is a sub-command
``python3 -m mitmproxy_httpolice`` is a sub-command
that prints the path to the script file::

$ python -m mitmproxy_httpolice
/home/vasiliy/.local/lib/python2.7/site-packages/mitmproxy_httpolice.py
$ python3 -m mitmproxy_httpolice
/home/vasiliy/.local/lib/python3.5/site-packages/mitmproxy_httpolice.py

``-o html`` tells HTTPolice to produce HTML reports
(omit it if you want a plain text report).
Expand All @@ -72,12 +72,12 @@ HTTPolice writes an HTML report to ``report.html``.
You can use the ``-s`` option to :ref:`silence <silence>` unwanted notices,
just as with the ``httpolice`` command-line tool::

$ mitmdump -s "`python -m mitmproxy_httpolice` -s 1089 -s 1194 report.txt"
$ mitmdump -s "`python3 -m mitmproxy_httpolice` -s 1089 -s 1194 report.txt"

mitmproxy/mitmdump itself has many interesting options.
One of the more useful features is the ability to dump traffic into a file.
If you do this, you can then “replay” it as many times as you wish::

$ mitmdump --wfile flows.dat
$ mitmdump --no-server --read-flows flows.dat \
> -s "`python -m mitmproxy_httpolice` /dev/stdout"
> -s "`python3 -m mitmproxy_httpolice` /dev/stdout"
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Quality Assurance',
],
Expand Down
2 changes: 1 addition & 1 deletion test_real_mitmdump.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def start(self):
fd, self.report_path = tempfile.mkstemp()
os.close(fd)
script_path = subprocess.check_output(
['python', '-m', 'mitmproxy_httpolice']).decode().strip()
['python3', '-m', 'mitmproxy_httpolice']).decode().strip()
self.process = subprocess.Popen([
'mitmdump', '-p', str(self.port), '-s',
"'%s' '%s'" % (script_path, self.report_path)
Expand Down

0 comments on commit afaacea

Please sign in to comment.