| Index: appengine/chromium_build_logs/third_party/googleapiclient/mimeparse.py
|
| diff --git a/appengine/chromium_build_logs/third_party/apiclient/mimeparse.py b/appengine/chromium_build_logs/third_party/googleapiclient/mimeparse.py
|
| similarity index 95%
|
| rename from appengine/chromium_build_logs/third_party/apiclient/mimeparse.py
|
| rename to appengine/chromium_build_logs/third_party/googleapiclient/mimeparse.py
|
| index cbb9d077e7522cb6dd2829e85212cf11c0264a73..bc9ad0944b5f5a5599835b1197cd418a076d47d6 100644
|
| --- a/appengine/chromium_build_logs/third_party/apiclient/mimeparse.py
|
| +++ b/appengine/chromium_build_logs/third_party/googleapiclient/mimeparse.py
|
| @@ -1,4 +1,4 @@
|
| -# Copyright (C) 2007 Joe Gregorio
|
| +# Copyright 2014 Joe Gregorio
|
| #
|
| # Licensed under the MIT License
|
|
|
| @@ -21,6 +21,9 @@ Contents:
|
| - best_match(): Choose the mime-type with the highest quality ('q')
|
| from a list of candidates.
|
| """
|
| +from __future__ import absolute_import
|
| +from functools import reduce
|
| +import six
|
|
|
| __version__ = '0.1.3'
|
| __author__ = 'Joe Gregorio'
|
| @@ -68,7 +71,7 @@ def parse_media_range(range):
|
| necessary.
|
| """
|
| (type, subtype, params) = parse_mime_type(range)
|
| - if not params.has_key('q') or not params['q'] or \
|
| + if 'q' not in params or not params['q'] or \
|
| not float(params['q']) or float(params['q']) > 1\
|
| or float(params['q']) < 0:
|
| params['q'] = '1'
|
| @@ -98,8 +101,8 @@ def fitness_and_quality_parsed(mime_type, parsed_ranges):
|
| target_subtype == '*')
|
| if type_match and subtype_match:
|
| param_matches = reduce(lambda x, y: x + y, [1 for (key, value) in \
|
| - target_params.iteritems() if key != 'q' and \
|
| - params.has_key(key) and value == params[key]], 0)
|
| + six.iteritems(target_params) if key != 'q' and \
|
| + key in params and value == params[key]], 0)
|
| fitness = (type == target_type) and 100 or 0
|
| fitness += (subtype == target_subtype) and 10 or 0
|
| fitness += param_matches
|
|
|