diff options
| author | Sebastian Heinlein <sebi@sebi-laptop> | 2007-01-04 18:30:10 +0100 |
|---|---|---|
| committer | Sebastian Heinlein <sebi@sebi-laptop> | 2007-01-04 18:30:10 +0100 |
| commit | d6976c5b0b79dff718b8c2334bc0749979957e5d (patch) | |
| tree | e34253bb88fc44a6bad096ec09b789cbb77fc602 | |
| parent | 55770e02463476f5d4713ff951cbab1f04934c19 (diff) | |
| download | python-apt-d6976c5b0b79dff718b8c2334bc0749979957e5d.tar.gz | |
* Make split_url always return proto, hostname and dir
(None if not available)
| -rw-r--r-- | AptSources/DistInfo.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/AptSources/DistInfo.py b/AptSources/DistInfo.py index 17526a73..9968c16b 100644 --- a/AptSources/DistInfo.py +++ b/AptSources/DistInfo.py @@ -116,7 +116,14 @@ class Repository: def split_url(url): ''' split a given URL into the protocoll, the hostname and the dir part ''' - return re.split(":*\/+", url, maxsplit=2) + url_splits = re.split(":*\/+", url, maxsplit=2) + length = len(url_splits) + if length == 3: + return url_splits + elif length == 2: + return [url_splits[0], url_splits[1], None] + else: + return [None, None, None] class DistInfo: def __init__(self, |
