aboutsummaryrefslogtreecommitdiffstats
path: root/pathod/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'pathod/utils.py')
-rw-r--r--pathod/utils.py50
1 files changed, 0 insertions, 50 deletions
diff --git a/pathod/utils.py b/pathod/utils.py
index d1e2dd00..3276198a 100644
--- a/pathod/utils.py
+++ b/pathod/utils.py
@@ -3,15 +3,6 @@ import sys
import netlib.utils
-SIZE_UNITS = dict(
- b=1024 ** 0,
- k=1024 ** 1,
- m=1024 ** 2,
- g=1024 ** 3,
- t=1024 ** 4,
-)
-
-
class MemBool(object):
"""
@@ -26,20 +17,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.
@@ -49,33 +26,6 @@ def parse_anchor_spec(s):
return tuple(s.split("=", 1))
-def xrepr(s):
- return repr(s)[1:-1]
-
-
-def inner_repr(s):
- """
- Returns the inner portion of a string or unicode repr (i.e. without the
- quotes)
- """
- if isinstance(s, unicode):
- return repr(s)[2:-1]
- else:
- return repr(s)[1:-1]
-
-
-def escape_unprintables(s):
- """
- Like inner_repr, but preserves line breaks.
- """
- s = s.replace("\r\n", "PATHOD_MARKER_RN")
- s = s.replace("\n", "PATHOD_MARKER_N")
- s = inner_repr(s)
- s = s.replace("PATHOD_MARKER_RN", "\n")
- s = s.replace("PATHOD_MARKER_N", "\n")
- return s
-
-
data = netlib.utils.Data(__name__)