diff options
author | Bogdano Arendartchuk <bogdano@mandriva.org> | 2008-11-11 17:21:41 +0000 |
---|---|---|
committer | Bogdano Arendartchuk <bogdano@mandriva.org> | 2008-11-11 17:21:41 +0000 |
commit | 3a7d4937f2fbd7b80f0762258380c82e1cbffe13 (patch) | |
tree | 2c1c1d6e66e065d30c60079c311437f28ccb5157 /RepSys/command.py | |
parent | 86b2db69c2c1935ec282ef449a42349e5634a228 (diff) | |
parent | bc9f60a727164caf513746b5fc04f999c968f799 (diff) | |
download | mgarepo-3a7d4937f2fbd7b80f0762258380c82e1cbffe13.tar mgarepo-3a7d4937f2fbd7b80f0762258380c82e1cbffe13.tar.gz mgarepo-3a7d4937f2fbd7b80f0762258380c82e1cbffe13.tar.bz2 mgarepo-3a7d4937f2fbd7b80f0762258380c82e1cbffe13.tar.xz mgarepo-3a7d4937f2fbd7b80f0762258380c82e1cbffe13.zip |
make the V1_6_X branch the trunk
Diffstat (limited to 'RepSys/command.py')
-rw-r--r-- | RepSys/command.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/RepSys/command.py b/RepSys/command.py index 8029e08..f1d61f7 100644 --- a/RepSys/command.py +++ b/RepSys/command.py @@ -1,6 +1,7 @@ #!/usr/bin/python from RepSys import Error, config -import sys, os, urllib +import sys, os +import urlparse import optparse __all__ = ["OptionParser", "do_command", "default_parent"] @@ -39,6 +40,10 @@ def do_command(parse_options_func, main_func): except Error, e: sys.stderr.write("error: %s\n" % str(e)) sys.exit(1) + except KeyboardInterrupt: + sys.stderr.write("interrupted\n") + sys.stderr.flush() + sys.exit(1) def default_parent(url): if url.find("://") == -1: @@ -46,8 +51,9 @@ def default_parent(url): if not default_parent: raise Error, "received a relative url, " \ "but default_parent was not setup" - type, rest = urllib.splittype(default_parent) - url = type+':'+os.path.normpath(rest+'/'+url) + parsed = list(urlparse.urlparse(default_parent)) + parsed[2] = os.path.normpath(parsed[2] + "/" + url) + url = urlparse.urlunparse(parsed) return url # vim:et:ts=4:sw=4 |