def get_source(visualization): for source in visualization.getRelatedItems(): if IDataCube.providedBy(source): return source return None
def handler(obj, evt): if IDataCube.providedBy(obj): datacube_handler(obj, evt)