PageRenderTime 24ms CodeModel.GetById 19ms app.highlight 4ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1.3.35/Examples/python/enum/runme.py

#
Python | 31 lines | 19 code | 9 blank | 3 comment | 0 complexity | e8a96319815ffcac13f3ff5f9c106f4b MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1# file: runme.py
 2
 3import example
 4
 5# ----- Object creation -----
 6
 7# Print out the value of some enums
 8print "*** color ***"
 9print "    RED    =", example.RED
10print "    BLUE   =", example.BLUE
11print "    GREEN  =", example.GREEN
12
13print "\n*** Foo::speed ***"
14print "    Foo_IMPULSE   =", example.Foo.IMPULSE
15print "    Foo_WARP      =", example.Foo.WARP
16print "    Foo_LUDICROUS =", example.Foo.LUDICROUS
17
18print "\nTesting use of enums with functions\n"
19
20example.enum_test(example.RED, example.Foo.IMPULSE)
21example.enum_test(example.BLUE,  example.Foo.WARP)
22example.enum_test(example.GREEN, example.Foo.LUDICROUS)
23example.enum_test(1234,5678)
24
25print "\nTesting use of enum with class method"
26f = example.Foo()
27
28f.enum_test(example.Foo.IMPULSE)
29f.enum_test(example.Foo.WARP)
30f.enum_test(example.Foo.LUDICROUS)
31