def unserialize(text): """ unserialize(text) -> RecentVistrailList """ root = ElementTree.fromstring(text) if root.tag != 'recentVistrails': return None vtlist = RecentVistrailList() for node in root.getchildren(): loc = FileLocator.from_xml(node) if loc is None: loc = DBLocator.from_xml(node, include_name=True) if loc is not None: vtlist.locators.append(loc) vtlist.locators_map[loc.name] = loc return vtlist