def importXml(self, filename): ''' :param str filename: name of XML file with proposals ''' doc = xml_utility.readValidXmlDoc(filename, agup_data.AGUP_MASTER_ROOT_TAG, agup_data.AGUP_XML_SCHEMA_FILE, alt_root_tag=ROOT_TAG, alt_schema=XML_SCHEMA_FILE, ) root = doc.getroot() if root.tag == agup_data.AGUP_MASTER_ROOT_TAG: proposals_node = root.find('Proposal_list') else: proposals_node = root # pre-agup reviewers file db = {} self.prop_id_list = [] self.cycle = root.get('cycle', None) or root.get('period', None) or '' for node in proposals_node.findall('Proposal'): prop_id = xml_utility.getXmlText(node, 'proposal_id') prop = proposal.AGUP_Proposal_Data(node, filename) db[prop_id] = prop self.prop_id_list.append(prop_id) self.prop_id_list = sorted(self.prop_id_list) self.proposals = db
def importXml(self, xmlFile, read_values=True): ''' :param str filename: name of XML file with Topics :param bool read_values: import topic values? ''' root_tag = agup_data.AGUP_MASTER_ROOT_TAG xsd_file = agup_data.AGUP_XML_SCHEMA_FILE doc = xml_utility.readValidXmlDoc(xmlFile, root_tag, xsd_file) self.clearAll() self.importXmlTopics(doc.getroot(), read_values)
def importXml(self, filename): ''' :param str filename: name of XML file with email template and keywords ''' doc = xml_utility.readValidXmlDoc(filename, agup_data.AGUP_MASTER_ROOT_TAG, agup_data.AGUP_XML_SCHEMA_FILE) root = doc.getroot() email_node = root.find('notification_email') if email_node is not None: text = xml_utility.getXmlText(email_node, 'email_template') self.email_template = text or self.email_template self.keyword_dict = {} for node in email_node.findall('Key'): k = node.attrib['name'] v = node.text.strip() self.keyword_dict[k] = v
def importXml(self, filename): ''' :param str filename: name of XML file with reviewers ''' doc = xml_utility.readValidXmlDoc(filename, agup_data.AGUP_MASTER_ROOT_TAG, agup_data.AGUP_XML_SCHEMA_FILE, ) root = doc.getroot() if root.tag == agup_data.AGUP_MASTER_ROOT_TAG: reviewers_node = root.find(REVIEW_PANEL_TAG) else: reviewers_node = root # pre-agup reviewers file raise RuntimeError, 'import of panel.xml file no longer supported' db = {} self.reviewer_sort_list = [] self.cycle = reviewers_node.get('period', None) for node in reviewers_node.findall('Reviewer'): sort_name = node.attrib['name'].strip() db[sort_name] = reviewer.AGUP_Reviewer_Data(node, filename) self.reviewer_sort_list.append(sort_name) self.reviewer_sort_list = sorted(self.reviewer_sort_list) self.reviewers = db
def importXml(self, filename): ''' :param str filename: name of XML file with reviewers ''' doc = xml_utility.readValidXmlDoc(filename, agup_data.AGUP_MASTER_ROOT_TAG, agup_data.AGUP_XML_SCHEMA_FILE, ) root = doc.getroot() if root.tag == agup_data.AGUP_MASTER_ROOT_TAG: reviewers_node = root.find(REVIEW_PANEL_TAG) else: reviewers_node = root # pre-agup reviewers file raise RuntimeError('import of panel.xml file no longer supported') db = {} self.reviewer_sort_list = [] self.cycle = reviewers_node.get('period', None) for node in reviewers_node.findall('Reviewer'): sort_name = node.attrib['name'].strip() db[sort_name] = reviewer.AGUP_Reviewer_Data(node, filename) self.reviewer_sort_list.append(sort_name) self.reviewer_sort_list = sorted(self.reviewer_sort_list) self.reviewers = db