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