aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'netlib/utils.py')
-rw-r--r--netlib/utils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/netlib/utils.py b/netlib/utils.py
index 2dfcafc6..31dcd622 100644
--- a/netlib/utils.py
+++ b/netlib/utils.py
@@ -119,6 +119,7 @@ def pretty_size(size):
class Data(object):
+
def __init__(self, name):
m = __import__(name)
dirname, _ = os.path.split(m.__file__)
@@ -137,8 +138,6 @@ class Data(object):
return fullpath
-
-
def is_valid_port(port):
if not 0 <= port <= 65535:
return False
@@ -221,6 +220,7 @@ def hostport(scheme, host, port):
else:
return "%s:%s" % (host, port)
+
def unparse_url(scheme, host, port, path=""):
"""
Returns a URL string, constructed from the specified compnents.
@@ -235,6 +235,7 @@ def urlencode(s):
s = [tuple(i) for i in s]
return urllib.urlencode(s, False)
+
def urldecode(s):
"""
Takes a urlencoded string and returns a list of (key, value) tuples.