def decorate(function): def handler(self, path, args, types, src): if len(args) == 0: return layer = self.mixer.layer_by_name(args[0]) if layer is None: return return function(self, layer, *args[1:]) return liblo.make_method(path, 's' + extra_types)(handler)
def decorate(function): def handler(self, path, args, types, src): return function(self) return liblo.make_method(path, '')(handler)
def decorate(function): def handler(self, path, args, types, src): if min_value <= args[0] <= max_value: return function(self, args[0]) return liblo.make_method(path, 'f')(handler)