part 3 : split basedoc in files, remove Utils dependance, move fontscale in gen,
update build system svn: r12603
This commit is contained in:
27
src/Utils.py
27
src/Utils.py
@ -431,33 +431,6 @@ from warnings import warn
|
||||
def set_titles(window, title, t, msg=None):
|
||||
warn('The Utils.set_titles is deprecated. Use ManagedWindow methods')
|
||||
|
||||
def gfloat(val):
|
||||
"""Convert to floating number, taking care of possible locale differences.
|
||||
|
||||
Useful for reading float values from text entry fields
|
||||
while under non-English locale.
|
||||
"""
|
||||
|
||||
try:
|
||||
return float(val)
|
||||
except:
|
||||
try:
|
||||
return float(val.replace('.', ', '))
|
||||
except:
|
||||
return float(val.replace(', ', '.'))
|
||||
return 0.0
|
||||
|
||||
def gformat(val):
|
||||
"""Performs ('%.3f' % val) formatting with the resulting string always
|
||||
using dot ('.') as a decimal point.
|
||||
|
||||
Useful for writing float values into XML when under non-English locale.
|
||||
"""
|
||||
|
||||
decimal_point = locale.localeconv()['decimal_point']
|
||||
return_val = "%.3f" % val
|
||||
return return_val.replace(decimal_point, '.')
|
||||
|
||||
def search_for(name):
|
||||
if name.startswith( '"' ):
|
||||
name = name.split('"')[1]
|
||||
|
Reference in New Issue
Block a user