diff options
| author | Aldo Cortesi <aldo@corte.si> | 2016-06-02 13:14:56 +1200 |
|---|---|---|
| committer | Aldo Cortesi <aldo@corte.si> | 2016-06-02 13:14:56 +1200 |
| commit | 07f7905f9182ad0098a5a2e37d40ce9b27298380 (patch) | |
| tree | 76ba04357353645f49e0f4bd8d835e471239b54b /examples | |
| parent | eaa3b308f7bb48256ccf56ea07d008fa5f9dd6ad (diff) | |
| parent | 09da1febbd9beac5ef5650274899439f5ce10e98 (diff) | |
| download | mitmproxy-07f7905f9182ad0098a5a2e37d40ce9b27298380.tar.gz mitmproxy-07f7905f9182ad0098a5a2e37d40ce9b27298380.tar.bz2 mitmproxy-07f7905f9182ad0098a5a2e37d40ce9b27298380.zip | |
Merge pull request #1191 from cortesi/utils
Utils reorganisation
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/custom_contentviews.py | 5 | ||||
| -rw-r--r-- | examples/tcp_message.py | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/examples/custom_contentviews.py b/examples/custom_contentviews.py index 6cc9314c..034f356c 100644 --- a/examples/custom_contentviews.py +++ b/examples/custom_contentviews.py @@ -1,7 +1,8 @@ import string import lxml.html import lxml.etree -from mitmproxy import utils, contentviews +from mitmproxy import contentviews +from netlib import strutils class ViewPigLatin(contentviews.View): @@ -10,7 +11,7 @@ class ViewPigLatin(contentviews.View): content_types = ["text/html"] def __call__(self, data, **metadata): - if utils.isXML(data): + if strutils.isXML(data): parser = lxml.etree.HTMLParser( strip_cdata=True, remove_blank_text=True diff --git a/examples/tcp_message.py b/examples/tcp_message.py index 52471ae9..2c210618 100644 --- a/examples/tcp_message.py +++ b/examples/tcp_message.py @@ -8,7 +8,7 @@ tcp_message Inline Script Hook API Demonstration example cmdline invocation: mitmdump -T --host --tcp ".*" -q -s examples/tcp_message.py ''' -from netlib.utils import clean_bin +from netlib import strutils def tcp_message(ctx, tcp_msg): @@ -22,4 +22,4 @@ def tcp_message(ctx, tcp_msg): "client" if tcp_msg.sender == tcp_msg.client_conn else "server", tcp_msg.sender.address, "server" if tcp_msg.receiver == tcp_msg.server_conn else "client", - tcp_msg.receiver.address, clean_bin(tcp_msg.message))) + tcp_msg.receiver.address, strutils.clean_bin(tcp_msg.message))) |
