def query(self, query):
if query and query.startswith('?'):
warn("You don't need to use a leading '?' when setting the query"
" string, this may be an error!", stacklevel=3)
if not query:
query_params = {}
else:
try:
# much faster than parse_qsl()
query_params = dict(( map(unquote_plus, (to_utf8(token) + '=').split('=', 2)[:2])
for token in query.split('&') ))
if len(query_params) == 1 and not query_params.values()[0]:
query_params = {}
else:
query = None
except Exception:
##raise # XXX DEBUG
query_params = {}
self.__query, self.__query_params = query, query_params
评论列表
文章目录