123456789101112131415161718192021222324 |
- from common import unpickle_args
- import urlparse
- try:
- from urlparse import parse_qs
- except ImportError:
- from cgi import parse_qs
- class Request(object):
- def __init__(self, url, handle):
- #: The entire request url.
- self.url = url
- #: The current request's handle, an integer.
- self.handle = int(handle)
- # urlparse doesn't like the 'plugin' scheme, so pass a protocol
- # relative url, e.g. //plugin.video.helloxbmc/path
- self.scheme, remainder = url.split(':', 1)
- parts = urlparse.urlparse(remainder)
- self.netloc, self.path, self.query_string = (
- parts[1], parts[2], parts[4])
- self.args = unpickle_args(parse_qs(self.query_string))
|