diff options
author | Mike Crute <mcrute@gmail.com> | 2010-04-21 00:16:16 -0400 |
---|---|---|
committer | Mike Crute <mcrute@gmail.com> | 2010-04-21 00:16:16 -0400 |
commit | e74452aabeb77ab8ab8f50a350d77e4d9e6914a2 (patch) | |
tree | 08a8bcd262622ded9f2996d1d37c174661df4b63 /obalie/utils.py | |
parent | 5156d1d7635806a237bdf9857702068290fc6340 (diff) | |
download | obalie-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.py | 10 |
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 | ||
11 | import shlex | 11 | import shlex |
12 | from urlparse import urljoin | ||
12 | from subprocess import Popen, PIPE | 13 | from subprocess import Popen, PIPE |
13 | from obalie.exceptions import ExecutableError | 14 | from 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 | |||
36 | def 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) | ||