summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2003-01-06 20:27:03 +0000
committerSkip Montanaro <skip@pobox.com>2003-01-06 20:27:03 +0000
commitf09b88ee2f4da2f7d6d46194d543aae0b823b9ae (patch)
tree3cd4e1db9dd03991c2f6f95c46f6cd535d33f757 /Lib
parentef893fe45286008fa908b8519bc8b5ad82b21988 (diff)
downloadcpython-git-f09b88ee2f4da2f7d6d46194d543aae0b823b9ae.tar.gz
* add mms (windows media) as another scheme
* reformat schemes to 80 columns
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_urlparse.py3
-rw-r--r--Lib/urlparse.py34
2 files changed, 18 insertions, 19 deletions
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
index a9d55d3737..6744867a47 100644
--- a/Lib/test/test_urlparse.py
+++ b/Lib/test/test_urlparse.py
@@ -28,6 +28,9 @@ class UrlParseTestCase(unittest.TestCase):
('imap://mail.python.org/mbox1',
('imap', 'mail.python.org', '/mbox1', '', '', ''),
('imap', 'mail.python.org', '/mbox1', '', '')),
+ ('mms://wms.sys.hinet.net/cts/Drama/09006251100.asf',
+ ('mms', 'wms.sys.hinet.net', '/cts/Drama/09006251100.asf', '', '', ''),
+ ('mms', 'wms.sys.hinet.net', '/cts/Drama/09006251100.asf', '', '')),
]:
result = urlparse.urlparse(url)
self.assertEqual(result, parsed)
diff --git a/Lib/urlparse.py b/Lib/urlparse.py
index 171092e92e..01064691de 100644
--- a/Lib/urlparse.py
+++ b/Lib/urlparse.py
@@ -8,26 +8,22 @@ __all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag",
"urlsplit", "urlunsplit"]
# A classification of schemes ('' means apply by default)
-uses_relative = dict.fromkeys(['ftp', 'http', 'gopher', 'nntp', 'imap', 'wais', 'file',
- 'https', 'shttp',
- 'prospero', 'rtsp', 'rtspu', ''])
-uses_netloc = dict.fromkeys(['ftp', 'http', 'gopher', 'nntp', 'telnet', 'imap', 'wais',
- 'file',
- 'https', 'shttp', 'snews',
- 'prospero', 'rtsp', 'rtspu', ''])
-non_hierarchical = dict.fromkeys(['gopher', 'hdl', 'mailto', 'news', 'telnet', 'wais',
- 'imap', 'snews', 'sip',
- ])
+uses_relative = dict.fromkeys(['ftp', 'http', 'gopher', 'nntp', 'imap',
+ 'wais', 'file', 'https', 'shttp', 'mms',
+ 'prospero', 'rtsp', 'rtspu', ''])
+uses_netloc = dict.fromkeys(['ftp', 'http', 'gopher', 'nntp', 'telnet',
+ 'imap', 'wais', 'file', 'mms', 'https', 'shttp',
+ 'snews', 'prospero', 'rtsp', 'rtspu', ''])
+non_hierarchical = dict.fromkeys(['gopher', 'hdl', 'mailto', 'news',
+ 'telnet', 'wais', 'imap', 'snews', 'sip'])
uses_params = dict.fromkeys(['ftp', 'hdl', 'prospero', 'http', 'imap',
- 'https', 'shttp', 'rtsp', 'rtspu', 'sip',
- ''])
-uses_query = dict.fromkeys(['http', 'wais', 'imap',
- 'https', 'shttp',
- 'gopher', 'rtsp', 'rtspu', 'sip',
- ''])
-uses_fragment = dict.fromkeys(['ftp', 'hdl', 'http', 'gopher', 'news', 'nntp', 'wais',
- 'https', 'shttp', 'snews',
- 'file', 'prospero', ''])
+ 'https', 'shttp', 'rtsp', 'rtspu', 'sip',
+ 'mms', ''])
+uses_query = dict.fromkeys(['http', 'wais', 'imap', 'https', 'shttp', 'mms',
+ 'gopher', 'rtsp', 'rtspu', 'sip', ''])
+uses_fragment = dict.fromkeys(['ftp', 'hdl', 'http', 'gopher', 'news',
+ 'nntp', 'wais', 'https', 'shttp', 'snews',
+ 'file', 'prospero', ''])
# Characters valid in scheme names
scheme_chars = ('abcdefghijklmnopqrstuvwxyz'