예제 #1
0
 def _parse_placeLabel(self):
     place_label_root = self.root.find(paths["Location_PlaceLabel_Path"],
                                       namespace)
     if place_label_root is not None:
         self.placeLabel = sanitize(place_label_root.text)
     else:
         self.placeLabel = ""
    def _parse_terms(self):
        terms = []
        term_roots = self.root.getparent().findall(self.term_path, namespace)
        for term_root in term_roots:
            term = sanitize(term_root.text)
            terms.append(term)

        return terms
예제 #3
0
 def _parse_label(self):
     # here we use the xpath(...) function instead of find/finall so that we can use the xpath 'not' feature
     # (see 'Type_Label_Path' in xpaths.py). This seems not to be supported by the find/findall function.
     label_root = self.root.xpath(paths["Type_Label_Path"],
                                  namespaces=namespace)
     if len(label_root) > 0:
         self.label = sanitize(label_root[0].text)
     else:
         self.label = ""
 def _parse_resourceType(self):
     resource_type_root = self.root.find(
         paths["Resource_resourceType_Path"], namespace)
     return sanitize(resource_type_root.text)
예제 #5
0
 def _parse_label(self):
     label = self.lido.find(paths["Artwork_Name_Path"], namespace)
     if label is not None:
         self.label = sanitize(label.text)
     else:
         self.label = None
 def _parse_alt_labels(self):
     for alt_label_root in self.root.findall(paths['Iconography_Alt_Label_Path'], namespace):
         alt_label = sanitize(alt_label_root.text)
         self.alt_labels.append(alt_label)
 def _parse_label(self):
     label_root = self.root.find(paths["Iconography_Label_Path"], namespace)
     if label_root is not None:
         self.label = sanitize(label_root.text)
     else:
         self.label = ""