[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
This commit is contained in:
parent
f590b74318
commit
3c28a101b9
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue