Skip to content
Snippets Groups Projects
Commit 3c28a101 authored by Stéphane Wirtel's avatar Stéphane Wirtel
Browse files

[FIX] Use an alternative for the locale.RADIXCHAR if this one doesn't exist

lp bug: https://launchpad.net/bugs/400614 fixed

bzr revid: stephane@openerp.com-20091007123807-qsn2uk6jarosd7nz
parent f590b743
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,7 @@ import reportlab
from lxml import etree
import copy
import tools
import locale
_regex = re.compile('\[\[(.+?)\]\]')
......@@ -133,6 +134,15 @@ units = [
def unit_get(size):
global units
if size:
if size.find('.') == -1:
decimal_point = '.'
try:
decimal_point = locale.RADIXCHAR
except:
decimal_point = locale.localeconv()['decimal_point']
size = size.replace(decimal_point, '.')
for unit in units:
res = unit[0].search(size, 0)
if res:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment