Slightly nicer "rank" computer in accept-header

master
pictuga 2014-01-08 01:36:31 +01:00
parent 32f9550be5
commit 69a8516cd1
1 changed files with 3 additions and 2 deletions

View File

@ -237,8 +237,9 @@ class SimpleDownload(urllib2.HTTPCookieProcessor):
self.accept = (self.accept,)
out = {}
for (i, group) in enumerate(self.accept):
rank = 1 - i*0.1
rank = 1.1
for group in self.accept:
rank = rank - 0.1
if isinstance(group, basestring):
if group in MIMETYPE: