Move special-case LDML value to a module global
Giving it a symbolic name is clearer (and saves me the need to duplicate the comment when I add some more references to it). This amends commit bcdd51cfae24731a73d008add23d3c1e85bbd8d0 Pick-to: 6.5 Task-number: QTBUG-115158 Change-Id: I7577e0cde783fcda840009c7aea46934964c6e4c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 0f770b0b34bcb5fa0a598b2ff76fe215fbc25f5c)
This commit is contained in:
parent
4d5aedac1d
commit
af4bccb562
@ -21,6 +21,9 @@ See individual classes for further detail.
|
|||||||
from localetools import Error
|
from localetools import Error
|
||||||
from dateconverter import convert_date
|
from dateconverter import convert_date
|
||||||
|
|
||||||
|
# The github version of CLDR uses '↑↑↑' to indicate "inherit"
|
||||||
|
INHERIT = '↑↑↑'
|
||||||
|
|
||||||
class Node (object):
|
class Node (object):
|
||||||
"""Wrapper for an arbitrary DOM node.
|
"""Wrapper for an arbitrary DOM node.
|
||||||
|
|
||||||
@ -205,8 +208,7 @@ class LocaleScanner (object):
|
|||||||
try:
|
try:
|
||||||
if draft is None or elt.draft <= draft:
|
if draft is None or elt.draft <= draft:
|
||||||
value = elt.dom.firstChild.nodeValue
|
value = elt.dom.firstChild.nodeValue
|
||||||
# The github version of CLDR uses '↑↑↑' to indicate "inherit"
|
if value != INHERIT:
|
||||||
if value != '↑↑↑':
|
|
||||||
return value
|
return value
|
||||||
except (AttributeError, KeyError):
|
except (AttributeError, KeyError):
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user