summaryrefslogtreecommitdiff
path: root/obalie/utils.py
diff options
context:
space:
mode:
authorMike Crute <mcrute@gmail.com>2010-04-21 00:16:16 -0400
committerMike Crute <mcrute@gmail.com>2010-04-21 00:16:16 -0400
commite74452aabeb77ab8ab8f50a350d77e4d9e6914a2 (patch)
tree08a8bcd262622ded9f2996d1d37c174661df4b63 /obalie/utils.py
parent5156d1d7635806a237bdf9857702068290fc6340 (diff)
downloadobalie-e74452aabeb77ab8ab8f50a350d77e4d9e6914a2.tar.bz2
obalie-e74452aabeb77ab8ab8f50a350d77e4d9e6914a2.tar.xz
obalie-e74452aabeb77ab8ab8f50a350d77e4d9e6914a2.zip
Adding basic info command
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)