aboutsummaryrefslogtreecommitdiffstats
path: root/pathod/utils.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2016-05-31 21:03:42 +1200
committerAldo Cortesi <aldo@corte.si>2016-05-31 21:03:42 +1200
commita7abf8b731658b4e7ed8705f7a94a6a62f08d51d (patch)
treecb86e2e483530f5e1e8b0c5d60839de21fcf7390 /pathod/utils.py
parent2f526393d29b6a03e43d1f6240175b4dfb13dc7d (diff)
parent4da125b6a098cc0fd8b1fd2878584beb5df75c6c (diff)
downloadmitmproxy-a7abf8b731658b4e7ed8705f7a94a6a62f08d51d.tar.gz
mitmproxy-a7abf8b731658b4e7ed8705f7a94a6a62f08d51d.tar.bz2
mitmproxy-a7abf8b731658b4e7ed8705f7a94a6a62f08d51d.zip
Merge pull request #1179 from cortesi/reorg
Start reorganising */utils.py
Diffstat (limited to 'pathod/utils.py')
-rw-r--r--pathod/utils.py23
1 files changed, 0 insertions, 23 deletions
diff --git a/pathod/utils.py b/pathod/utils.py
index 8c6d6290..fe12f541 100644
--- a/pathod/utils.py
+++ b/pathod/utils.py
@@ -5,15 +5,6 @@ import netlib.utils
from netlib.utils import bytes_to_escaped_str
-SIZE_UNITS = dict(
- b=1024 ** 0,
- k=1024 ** 1,
- m=1024 ** 2,
- g=1024 ** 3,
- t=1024 ** 4,
-)
-
-
class MemBool(object):
"""
@@ -28,20 +19,6 @@ class MemBool(object):
return bool(v)
-def parse_size(s):
- try:
- return int(s)
- except ValueError:
- pass
- for i in SIZE_UNITS.keys():
- if s.endswith(i):
- try:
- return int(s[:-1]) * SIZE_UNITS[i]
- except ValueError:
- break
- raise ValueError("Invalid size specification.")
-
-
def parse_anchor_spec(s):
"""
Return a tuple, or None on error.