[anaconda/rhel7-branch+master 4/4] Be more liberal in what is accepted as a size unit.

David Shea dshea at redhat.com
Thu Jan 16 00:54:55 UTC 2014


On 01/15/2014 06:17 PM, David Lehman wrote:
> On Wed, 2014-01-15 at 17:37 -0500, David Shea wrote:
>> On 01/15/2014 05:34 PM, David Shea wrote:
>>> Not all size specifications will end with a letter. For example: the
>>> translation of "B" for byte in Telugu ends with a vowel sign,
>>> categorized in Unicode as a non-spacing mark. Instead check whether the
>>> size string ends with a [0-9]: if so, the unit is missing.
> What about '23.' ?

Aww, crap. The easy answer would be to change the regex to r'[\d.]$', 
and I think I'd like to go ahead and do that for RHEL, but this raises a 
larger point of what to do, for example, with '23,'

Python makes the kind of annoying/insane decision to just up and ignore 
LC_NUMERIC unless you use the string parsing and formatting functions in 
the locale module, so we have kind of a weird situation in that any 
number converted to a string from python will use a period as the 
decimal point, but any number we display through C (such as floats in a 
ListStore) will use the locale-dependent decimal point. I think the 
difference only matters on rhel7-branch now, but neither rhel7 nor 
master would know what to do with commas in user input.

In summary:

+        if size_text and not re.search(r'[\d.]$', size_text):

for now, and I'll take a closer look at better localizing numeric values.

>
>>> Resolves: rhbz#1039485
>>> ---
>>>    pyanaconda/ui/gui/spokes/custom.py | 13 +++++++------
>>>    1 file changed, 7 insertions(+), 6 deletions(-)
>>>
>>>
>> On master, this will also make the unicodedata import unnecessary, so
>> I'll remove that.
>> _______________________________________________
>> anaconda-patches mailing list
>> anaconda-patches at lists.fedorahosted.org
>> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches



More information about the anaconda-patches mailing list