408 |
408 |
409 >>> u = ui(); s = 'foo' |
409 >>> u = ui(); s = 'foo' |
410 >>> u.setconfig(s, 'float1', '42') |
410 >>> u.setconfig(s, 'float1', '42') |
411 >>> u.configwith(float, s, 'float1') |
411 >>> u.configwith(float, s, 'float1') |
412 42.0 |
412 42.0 |
413 >>> u.setconfig(s, 'float2', '-4.2') |
413 >>> u.setconfig(s, 'float2', '-4.25') |
414 >>> u.configwith(float, s, 'float2') |
414 >>> u.configwith(float, s, 'float2') |
415 -4.2 |
415 -4.25 |
416 >>> u.configwith(float, s, 'unknown', 7) |
416 >>> u.configwith(float, s, 'unknown', 7) |
417 7 |
417 7 |
418 >>> u.setconfig(s, 'invalid', 'somevalue') |
418 >>> u.setconfig(s, 'invalid', 'somevalue') |
419 >>> u.configwith(float, s, 'invalid') |
419 >>> u.configwith(float, s, 'invalid') |
420 Traceback (most recent call last): |
420 Traceback (most recent call last): |