aboutsummaryrefslogtreecommitdiffstats
path: root/pathod
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-06-07 17:12:52 +1200
committerAldo Cortesi <aldo@nullcube.com>2016-06-07 17:12:52 +1200
commit1ffc273c9433fc8840b71c79879ae427c93313bd (patch)
treea656cb3f336a64d37967dbd4c36cad040370d72a /pathod
parentb180bfcf35302cb37f93be60ff954c6d645002b0 (diff)
downloadmitmproxy-1ffc273c9433fc8840b71c79879ae427c93313bd.tar.gz
mitmproxy-1ffc273c9433fc8840b71c79879ae427c93313bd.tar.bz2
mitmproxy-1ffc273c9433fc8840b71c79879ae427c93313bd.zip
Utils cleanups
- Move more stuff that belongs in netlib.human - Move some stuff to near the only use - Zap mitmproxy.utils.timestamp(). I see the rationale, but we used it interchangeably with time.time() throughout the project. Since time.time() dominates in the codebase and timestamp() is such low utility, away it goes.
Diffstat (limited to 'pathod')
-rw-r--r--pathod/pathod_cmdline.py13
-rw-r--r--pathod/utils.py9
2 files changed, 11 insertions, 11 deletions
diff --git a/pathod/pathod_cmdline.py b/pathod/pathod_cmdline.py
index 5ca2ca85..5bb0cdd3 100644
--- a/pathod/pathod_cmdline.py
+++ b/pathod/pathod_cmdline.py
@@ -5,7 +5,16 @@ import os.path
import re
from netlib import tcp, human
-from . import pathod, version, utils
+from . import pathod, version
+
+
+def parse_anchor_spec(s):
+ """
+ Return a tuple, or None on error.
+ """
+ if "=" not in s:
+ return None
+ return tuple(s.split("=", 1))
def args_pathod(argv, stdout_=sys.stdout, stderr_=sys.stderr):
@@ -188,7 +197,7 @@ def args_pathod(argv, stdout_=sys.stdout, stderr_=sys.stderr):
alst = []
for i in args.anchors:
- parts = utils.parse_anchor_spec(i)
+ parts = parse_anchor_spec(i)
if not parts:
return parser.error("Invalid anchor specification: %s" % i)
alst.append(parts)
diff --git a/pathod/utils.py b/pathod/utils.py
index 3276198a..9b220e9a 100644
--- a/pathod/utils.py
+++ b/pathod/utils.py
@@ -17,15 +17,6 @@ class MemBool(object):
return bool(v)
-def parse_anchor_spec(s):
- """
- Return a tuple, or None on error.
- """
- if "=" not in s:
- return None
- return tuple(s.split("=", 1))
-
-
data = netlib.utils.Data(__name__)