From 1407830280383e50a8af848a0c564c4912df5a52 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Thu, 20 Oct 2016 09:45:18 +1300 Subject: [PATCH] netlib.human -> mitmproxy.utils.human --- mitmproxy/addons/dumper.py | 2 +- mitmproxy/tools/cmdline.py | 2 +- mitmproxy/tools/console/common.py | 2 +- mitmproxy/tools/console/flowdetailview.py | 2 +- mitmproxy/tools/console/statusbar.py | 2 +- {netlib => mitmproxy/utils}/human.py | 0 netlib/http/response.py | 2 +- netlib/websockets/frame.py | 2 +- pathod/language/base.py | 2 +- pathod/log.py | 3 ++- pathod/pathod_cmdline.py | 2 +- test/{netlib/test_human.py => mitmproxy/test_utils_human.py} | 3 ++- test/mitmproxy/test_utils_lrucache.py | 4 ++-- 13 files changed, 15 insertions(+), 13 deletions(-) rename {netlib => mitmproxy/utils}/human.py (100%) rename test/{netlib/test_human.py => mitmproxy/test_utils_human.py} (96%) diff --git a/mitmproxy/addons/dumper.py b/mitmproxy/addons/dumper.py index 04dfb42cb..013fa3378 100644 --- a/mitmproxy/addons/dumper.py +++ b/mitmproxy/addons/dumper.py @@ -8,7 +8,7 @@ from mitmproxy import contentviews from mitmproxy import ctx from mitmproxy import exceptions from mitmproxy import flowfilter -from netlib import human +from mitmproxy.utils import human from netlib import strutils diff --git a/mitmproxy/tools/cmdline.py b/mitmproxy/tools/cmdline.py index 41770631d..b83694efc 100644 --- a/mitmproxy/tools/cmdline.py +++ b/mitmproxy/tools/cmdline.py @@ -5,7 +5,7 @@ from mitmproxy import exceptions from mitmproxy import flowfilter from mitmproxy import options from mitmproxy import platform -from netlib import human +from mitmproxy.utils import human from netlib import tcp from mitmproxy import version diff --git a/mitmproxy/tools/console/common.py b/mitmproxy/tools/console/common.py index dc4cfe18f..53411d17c 100644 --- a/mitmproxy/tools/console/common.py +++ b/mitmproxy/tools/console/common.py @@ -10,7 +10,7 @@ import netlib from mitmproxy.utils import lrucache from mitmproxy.tools.console import signals from mitmproxy import export -from netlib import human +from mitmproxy.utils import human try: import pyperclip diff --git a/mitmproxy/tools/console/flowdetailview.py b/mitmproxy/tools/console/flowdetailview.py index f13f9a1df..7591c3d1a 100644 --- a/mitmproxy/tools/console/flowdetailview.py +++ b/mitmproxy/tools/console/flowdetailview.py @@ -1,7 +1,7 @@ import urwid from mitmproxy.tools.console import common, searchable -from netlib import human +from mitmproxy.utils import human def maybe_timestamp(base, attr): diff --git a/mitmproxy/tools/console/statusbar.py b/mitmproxy/tools/console/statusbar.py index 99f73727b..ac41b213d 100644 --- a/mitmproxy/tools/console/statusbar.py +++ b/mitmproxy/tools/console/statusbar.py @@ -6,7 +6,7 @@ import netlib.http.url from mitmproxy.tools.console import common from mitmproxy.tools.console import pathedit from mitmproxy.tools.console import signals -from netlib import human +from mitmproxy.utils import human class ActionBar(urwid.WidgetWrap): diff --git a/netlib/human.py b/mitmproxy/utils/human.py similarity index 100% rename from netlib/human.py rename to mitmproxy/utils/human.py diff --git a/netlib/http/response.py b/netlib/http/response.py index a8b48be04..12dba92a7 100644 --- a/netlib/http/response.py +++ b/netlib/http/response.py @@ -1,6 +1,6 @@ import time from email.utils import parsedate_tz, formatdate, mktime_tz -from netlib import human +from mitmproxy.utils import human from netlib import multidict from netlib.http import cookies from netlib.http import headers as nheaders diff --git a/netlib/websockets/frame.py b/netlib/websockets/frame.py index b58fa2897..02d741125 100644 --- a/netlib/websockets/frame.py +++ b/netlib/websockets/frame.py @@ -5,7 +5,7 @@ import io from netlib import tcp from netlib import strutils from netlib import utils -from netlib import human +from mitmproxy.utils import human from .masker import Masker diff --git a/pathod/language/base.py b/pathod/language/base.py index 11f0899d4..7410bbd4d 100644 --- a/pathod/language/base.py +++ b/pathod/language/base.py @@ -5,7 +5,7 @@ import functools import pyparsing as pp from netlib import strutils -from netlib import human +from mitmproxy.utils import human from . import generators, exceptions diff --git a/pathod/log.py b/pathod/log.py index 37100bb1d..0d1bca414 100644 --- a/pathod/log.py +++ b/pathod/log.py @@ -1,6 +1,7 @@ import time -from netlib import strutils, human +from netlib import strutils +from mitmproxy.utils import human def write_raw(fp, lines, timestamp=True): diff --git a/pathod/pathod_cmdline.py b/pathod/pathod_cmdline.py index e467ef308..8d6ee2b6e 100644 --- a/pathod/pathod_cmdline.py +++ b/pathod/pathod_cmdline.py @@ -5,7 +5,7 @@ import os.path import re from netlib import tcp -from netlib import human +from mitmproxy.utils import human from mitmproxy import version from . import pathod diff --git a/test/netlib/test_human.py b/test/mitmproxy/test_utils_human.py similarity index 96% rename from test/netlib/test_human.py rename to test/mitmproxy/test_utils_human.py index bb97dc545..08609887a 100644 --- a/test/netlib/test_human.py +++ b/test/mitmproxy/test_utils_human.py @@ -1,5 +1,6 @@ import time -from netlib import human, tutils +from mitmproxy.utils import human +from netlib import tutils def test_format_timestamp(): diff --git a/test/mitmproxy/test_utils_lrucache.py b/test/mitmproxy/test_utils_lrucache.py index f75fb5e81..07b96b4d0 100644 --- a/test/mitmproxy/test_utils_lrucache.py +++ b/test/mitmproxy/test_utils_lrucache.py @@ -1,8 +1,8 @@ -from mitmproxy import utils +from mitmproxy.utils import lrucache def test_LRUCache(): - cache = utils.LRUCache(2) + cache = lrucache.LRUCache(2) class Foo: ran = False