diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2013-01-05 15:25:09 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2013-01-05 15:25:09 +1300 |
commit | 3886ccae9379d065e54e0eb7e961992ff3c0ee62 (patch) | |
tree | 33db7b5c057f508ce02aebac562e58fecfe7ddf2 /libpathod/utils.py | |
parent | d7f641c6ee1033232110c9b42c3b48cc5b719520 (diff) | |
download | mitmproxy-3886ccae9379d065e54e0eb7e961992ff3c0ee62.tar.gz mitmproxy-3886ccae9379d065e54e0eb7e961992ff3c0ee62.tar.bz2 mitmproxy-3886ccae9379d065e54e0eb7e961992ff3c0ee62.zip |
Provisional proxy mode support for pathod.
Diffstat (limited to 'libpathod/utils.py')
-rw-r--r-- | libpathod/utils.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libpathod/utils.py b/libpathod/utils.py index 70a97cff..26e9427d 100644 --- a/libpathod/utils.py +++ b/libpathod/utils.py @@ -8,6 +8,19 @@ SIZE_UNITS = dict( t = 1024**4, ) + +class MemBool: + """ + Truth-checking with a memory, for use in chained if statements. + """ + def __init__(self): + self.v = None + + def __call__(self, v): + self.v = v + return bool(v) + + def parse_size(s): try: return int(s) |