def receiver(signal, **kwargs):
 def _decorator(func):
  if isinstance(signal, (list, tuple)):
   for s in signal:
    s.connect(func, **kwargs)
  else:
   signal.connect(func, **kwargs)
  return func
 return _decorator

def receiver ( signal , ** kwargs ) : def _decorator ( func ) : if isinstance ( signal , ( list , tuple ) ) : for s in signal : s . connect ( func , ** kwargs ) else : signal . connect ( func , ** kwargs ) return func return _decorator
a decorator for connecting receivers to signals .