5 from string
import ascii_letters
, digits
8 from libglibcodegen
import signal_to_marshal_name
, method_to_glue_marshal_name
11 class Generator(object):
13 def __init__(self
, dom
):
17 def do_method(self
, method
):
18 marshaller
= method_to_glue_marshal_name(method
, 'PREFIX')
20 assert '__' in marshaller
21 rhs
= marshaller
.split('__', 1)[1].split('_')
23 self
.marshallers
[marshaller
] = rhs
25 def do_signal(self
, signal
):
26 marshaller
= signal_to_marshal_name(signal
, 'PREFIX')
28 assert '__' in marshaller
29 rhs
= marshaller
.split('__', 1)[1].split('_')
31 self
.marshallers
[marshaller
] = rhs
34 methods
= self
.dom
.getElementsByTagName('method')
36 for method
in methods
:
37 self
.do_method(method
)
39 signals
= self
.dom
.getElementsByTagName('signal')
41 for signal
in signals
:
42 self
.do_signal(signal
)
44 all
= self
.marshallers
.keys()
46 for marshaller
in all
:
47 rhs
= self
.marshallers
[marshaller
]
48 if not marshaller
.startswith('g_cclosure'):
49 print 'VOID:' + ','.join(rhs
)
51 if __name__
== '__main__':
53 dom
= xml
.dom
.minidom
.parse(argv
[0])