import xml.etree.ElementTree as ET from ViewManager import ViewManager # https://docs.python.org/3.6/library/xml.etree.elementtree.html views_root = ET.parse('../xml_conf/views.xml').getroot() view_managers = {} for id, xml_view_child in enumerate(views_root): vm = ViewManager(id, xml_view_child) view_managers[str(id)] = vm vm.update_view() view_chain_mapping = {} for id, vm in view_managers.items(): view_chain_mapping[vm.id] = [r.split("/")[0] for r in vm.get_refs()] print("Plot refs for view {}: {}".format(vm.id, view_chain_mapping[vm.id])) transformations = [] for id, vm in view_managers.items(): transformations += vm.get_transformations() print("Transformations for view {}: {}".format(vm.id, transformations)) transformations = list(dict.fromkeys(transformations)) """ Plot refs for view 0: ['lst_dl1', ''] Transformations for view 0: ['tailcuts_clean'] """