class Signal(Callable):
- def __init__(self, name, retval, parameters, when="first",
+ def __init__(self, name, retval, parameters, when=None,
no_recurse=False, detailed=False, action=False,
no_hooks=False):
Callable.__init__(self, name, retval, parameters, False)
rtype = ast.Type.create_from_gtype_name(rctype)
return_ = ast.Return(rtype)
parameters = []
- when = signal_info.attrib['when']
+ when = signal_info.attrib.get('when')
no_recurse = signal_info.attrib.get('no-recurse', '0') == '1'
detailed = signal_info.attrib.get('detailed', '0') == '1'
action = signal_info.attrib.get('action', '0') == '1'
func = klass(name, retval, parameters, throws)
elif klass is ast.Signal:
func = klass(name, retval, parameters,
- when=node.attrib.get('when', 'first'),
+ when=node.attrib.get('when'),
no_recurse=node.attrib.get('no-recurse', '0') == '1',
detailed=node.attrib.get('detailed', '0') == '1',
action=node.attrib.get('action', '0') == '1',
self._write_type(field.type)
def _write_signal(self, signal):
- attrs = [('name', signal.name),
- ('when', signal.when)]
+ attrs = [('name', signal.name)]
+ if signal.when:
+ attrs.append(('when', signal.when))
if signal.no_recurse:
attrs.append(('no-recurse', '1'))
if signal.detailed: