http://hg.code.sf.net:8000/p/roundup/code/atom-log/tip/roundup/cgi/accept_language.py Mercurial Repository: p/roundup/code: roundup/cgi/accept_language.py history 2022-09-14T20:19:59-04:00 fake8 whitespace; variable name replacement http://hg.code.sf.net:8000/p/roundup/code/#changeset-63c9680eed20409d662c3460b8aaf02f2177172d John Rouillard rouilj@ieee.org 2022-09-14T20:19:59-04:00 2022-09-14T20:19:59-04:00
changeset 63c9680eed20
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description fake8 whitespace; variable name replacement
files
accept_language parse; fix priority order; preserve insertion order http://hg.code.sf.net:8000/p/roundup/code/#changeset-3b945aee0919f3d8e71acb8ce920d5dcbbd17064 John Rouillard rouilj@ieee.org 2021-03-21T18:39:43-04:00 2021-03-21T18:39:43-04:00
changeset 3b945aee0919
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description accept_language parse; fix priority order; preserve insertion order

There are conditions under which the order is not correctly returned.

Use hashq.hashpop in a loop to get items out of hash (list) in proper
priority order. Make 3 element tuples in hashq include insertion
order. This makes tuples inserted later lower in priority when
priority q values are the same. Makes:

"zn;q=1.0;q= 1.0,pt-br,en-US; q=0.5"

return ['zn', 'pt_br', 'en_US'] (pt_br is default prio of 1 like
zn). Otherwise we get ['pt_br', 'zn', 'en_US'] since 'p' > 'z'.
files
flake8 cleanups. whie space changes. http://hg.code.sf.net:8000/p/roundup/code/#changeset-ed8a9974c1bdb12f2a613ccc9f72f5e320dc96e3 John Rouillard rouilj@ieee.org 2020-01-03T20:10:45-05:00 2020-01-03T20:10:45-05:00
changeset ed8a9974c1bd
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description flake8 cleanups. whie space changes.
files
Try to fix: http://hg.code.sf.net:8000/p/roundup/code/#changeset-936275dfe1fa590784a6a19bee12297f094b0d06 John Rouillard rouilj@ieee.org 2019-06-12T20:34:47-04:00 2019-06-12T20:34:47-04:00
changeset 936275dfe1fa
branch
bookmark
tag
user John Rouillard <rouilj@ieee.org>
description Try to fix:

DeprecationWarning: invalid escape sequence \d
DeprecationWarning: invalid escape sequence \s
DeprecationWarning: invalid escape sequence \)

Strings under python 3 are unicode strings rather then "regular"
strings as under python 2. So all regexps need to be raw strings.
We will see how many I fixed and if I broke any.
files
Python 3 preparation: update string translate method call in cgi/accept_language.py. http://hg.code.sf.net:8000/p/roundup/code/#changeset-b00cd44fea1641fabf357e4fd352213923025bfd Joseph Myers jsm@polyomino.org.uk 2018-07-25T11:44:01+00:00 2018-07-25T11:44:01+00:00
changeset b00cd44fea16
branch
bookmark
tag
user Joseph Myers <jsm@polyomino.org.uk>
description Python 3 preparation: update string translate method call in cgi/accept_language.py.

The str translate method in Python 3 is sufficiently different from
that in Python 2 that different arguments are needed here. Note that
the existing code "ascii = ''.join([chr(x) for x in range(256)])" is
redundant with both versions (in Python 2, None can be used instead as
the first translate argument from Python 2.6 onwards).
files
more modernisation http://hg.code.sf.net:8000/p/roundup/code/#changeset-74476eaac38aba2f682d09951a669f673065592f Richard Jones richard@users.sourceforge.net 2010-02-26T00:38:53+00:00 2010-02-26T00:38:53+00:00
changeset 74476eaac38a
branch
bookmark
tag
user Richard Jones <richard@users.sourceforge.net>
description more modernisation
files
Parse the Accept-Language header as defined in RFC2616. http://hg.code.sf.net:8000/p/roundup/code/#changeset-52f89836d05b853abc5301326853b14ed93a92cc Alexander Smishlajev a1s@users.sourceforge.net 2005-12-03T09:31:37+00:00 2005-12-03T09:31:37+00:00
changeset 52f89836d05b
branch
bookmark
tag
user Alexander Smishlajev <a1s@users.sourceforge.net>
description Parse the Accept-Language header as defined in RFC2616.
files