aboutsummaryrefslogtreecommitdiffstats
path: root/pathod/language/base.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-05-31 19:32:08 +1200
committerAldo Cortesi <aldo@nullcube.com>2016-05-31 19:32:08 +1200
commitb2f63458fcda7878d5cf674c2f1e9ca7db5bf3ce (patch)
tree639b7e8408a52dc8828f579f324dab065e4b4cb2 /pathod/language/base.py
parentec34cae6181d6af0150ac730d70b96104a07e9d5 (diff)
downloadmitmproxy-b2f63458fcda7878d5cf674c2f1e9ca7db5bf3ce.tar.gz
mitmproxy-b2f63458fcda7878d5cf674c2f1e9ca7db5bf3ce.tar.bz2
mitmproxy-b2f63458fcda7878d5cf674c2f1e9ca7db5bf3ce.zip
Move human-friendly format functions to netlib.human, remove redundant implementations
Diffstat (limited to 'pathod/language/base.py')
-rw-r--r--pathod/language/base.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pathod/language/base.py b/pathod/language/base.py
index 54ca6492..97111ed6 100644
--- a/pathod/language/base.py
+++ b/pathod/language/base.py
@@ -5,8 +5,8 @@ import pyparsing as pp
from six.moves import reduce
from netlib.utils import escaped_str_to_bytes, bytes_to_escaped_str
+from netlib import human
-from .. import utils
from . import generators, exceptions
@@ -158,7 +158,7 @@ class TokValueGenerate(Token):
self.usize, self.unit, self.datatype = usize, unit, datatype
def bytes(self):
- return self.usize * utils.SIZE_UNITS[self.unit]
+ return self.usize * human.SIZE_UNITS[self.unit]
def get_generator(self, settings_):
return generators.RandomGenerator(self.datatype, self.bytes())
@@ -173,7 +173,7 @@ class TokValueGenerate(Token):
u = reduce(
operator.or_,
- [pp.Literal(i) for i in utils.SIZE_UNITS.keys()]
+ [pp.Literal(i) for i in human.SIZE_UNITS.keys()]
).leaveWhitespace()
e = e + pp.Optional(u, default=None)