18 |
from wxPython.grid import * |
from wxPython.grid import * |
19 |
|
|
20 |
from Thuban import _ |
from Thuban import _ |
|
from Thuban.common import * |
|
21 |
from Thuban.UI.common import * |
from Thuban.UI.common import * |
22 |
|
|
23 |
from Thuban.Model.classification import * |
from Thuban.Model.classification import * |
477 |
elif type in (FIELDTYPE_INT, FIELDTYPE_DOUBLE): |
elif type in (FIELDTYPE_INT, FIELDTYPE_DOUBLE): |
478 |
|
|
479 |
if type == FIELDTYPE_INT: |
if type == FIELDTYPE_INT: |
480 |
|
# the float call allows the user to enter 1.0 for 1 |
481 |
conv = lambda p: int(float(p)) |
conv = lambda p: int(float(p)) |
482 |
else: |
else: |
483 |
conv = lambda p: p |
conv = lambda p: p |
492 |
# function. |
# function. |
493 |
# |
# |
494 |
try: |
try: |
495 |
return (conv(Str2Num(value)),) |
return (conv(value),) |
496 |
except ValueError: |
except ValueError: |
497 |
i = value.find('-') |
i = value.find('-') |
498 |
if i == 0: |
if i == 0: |
499 |
i = value.find('-', 1) |
i = value.find('-', 1) |
500 |
|
|
501 |
return (conv(Str2Num(value[:i])), conv(Str2Num(value[i+1:]))) |
return (conv(value[:i]), conv(value[i+1:])) |
502 |
|
|
503 |
assert False # shouldn't get here |
assert False # shouldn't get here |
504 |
return (0,) |
return (0,) |
558 |
# |
# |
559 |
if len(dataInfo) == 1: |
if len(dataInfo) == 1: |
560 |
if not isinstance(group, ClassGroupSingleton): |
if not isinstance(group, ClassGroupSingleton): |
561 |
ngroup = ClassGroupSingleton(prop = props) |
ngroup = ClassGroupSingleton(props = props) |
562 |
changed = True |
changed = True |
563 |
ngroup.SetValue(dataInfo[0]) |
ngroup.SetValue(dataInfo[0]) |
564 |
elif len(dataInfo) == 2: |
elif len(dataInfo) == 2: |
565 |
if not isinstance(group, ClassGroupRange): |
if not isinstance(group, ClassGroupRange): |
566 |
ngroup = ClassGroupRange(prop = props) |
ngroup = ClassGroupRange(props = props) |
567 |
changed = True |
changed = True |
568 |
ngroup.SetRange(dataInfo[0], dataInfo[1]) |
ngroup.SetRange(dataInfo[0], dataInfo[1]) |
569 |
else: |
else: |