summaryrefslogtreecommitdiff
path: root/obalie/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'obalie/utils.py')
-rw-r--r--obalie/utils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/obalie/utils.py b/obalie/utils.py
index dcf476a..2d4be0e 100644
--- a/obalie/utils.py
+++ b/obalie/utils.py
@@ -9,6 +9,7 @@ Miscellaneous Utility Commands
9 9
10 10
11import shlex 11import shlex
12from urlparse import urljoin
12from subprocess import Popen, PIPE 13from subprocess import Popen, PIPE
13from obalie.exceptions import ExecutableError 14from obalie.exceptions import ExecutableError
14 15
@@ -30,3 +31,12 @@ def run_command(command, raw_output=False):
30 return stdout 31 return stdout
31 else: 32 else:
32 return stdout.splitlines(True) 33 return stdout.splitlines(True)
34
35
36def join_url(base, path):
37 """
38 Joins a URL but ignores the leading slash on the path that would
39 otherwise truncate the base part back to the hostname.
40 """
41 path = path.lstrip('/')
42 return urljoin(base, path)