Don't reference removed files in Makefile
[python/dscho.git] / Tools / modulator / EXAMPLE.py
blob40436993db294865b3ebd84a359d67e51ab34da4
2 # Example input file for modulator if you don't have tk.
4 # You may also have to strip some imports out of modulator to make
5 # it work.
7 # Generate code for a simple object with a method called sample
9 o = genmodule.object()
10 o.name = 'simple object'
11 o.abbrev = 'simp'
12 o.methodlist = ['sample']
13 o.funclist = ['new']
16 # Generate code for an object that looks numberish
18 o2 = genmodule.object()
19 o2.name = 'number-like object'
20 o2.abbrev = 'nl'
21 o2.typelist = ['tp_as_number']
22 o2.funclist = ['new', 'tp_repr', 'tp_compare']
25 # Generate code for a method with a full complement of functions,
26 # some methods, accessible as sequence and allowing structmember.c type
27 # structure access as well.
29 o3 = genmodule.object()
30 o3.name = 'over-the-top object'
31 o3.abbrev = 'ot'
32 o3.methodlist = ['method1', 'method2']
33 o3.funclist = ['new', 'tp_dealloc', 'tp_print', 'tp_getattr', 'tp_setattr',
34 'tp_compare', 'tp_repr', 'tp_hash']
35 o3.typelist = ['tp_as_sequence', 'structure']
38 # Now generate code for a module that incorporates these object types.
39 # Also add the boilerplates for functions to create instances of each
40 # type.
42 m = genmodule.module()
43 m.name = 'sample'
44 m.abbrev = 'sample'
45 m.methodlist = ['newsimple', 'newnumberish', 'newott']
46 m.objects = [o, o2, o3]