Changeset 454:73e3273c7624 in documentViewer
- Timestamp:
- Jul 15, 2011, 9:02:26 AM (13 years ago)
- Branch:
- elementtree
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentViewer.py
r453 r454 500 500 501 501 for x in range(cut): 502 503 path=getParentDir(path) 502 path=getParentDir(path) 504 503 505 504 infoUrl=self.digilibBaseUrl+"/dirInfo-xml.jsp?mo=dir&fn="+path … … 631 630 logging.debug("documentViewer (getbibinfofromindexmeta cutted) path: %s"%(path)) 632 631 # put in all raw bib fields as dict "bib" 633 bib = dom.find(".//bib /*")632 bib = dom.find(".//bib") 634 633 #bib = dom.xpath("//bib/*") 635 if bib and len(bib)>0:634 if bib is not None: 636 635 bibinfo = {} 637 636 for e in bib: 638 bibinfo[e.localName] = getTextFromNode(e) 637 bibinfo[e.tag] = getText(e) 638 639 639 docinfo['bib'] = bibinfo 640 640 641 641 # extract some fields (author, title, year) according to their mapping 642 642 metaData=self.metadata.main.meta.bib 643 bib = dom.find(".//bib")644 643 bibtype=bib.get("type") 645 644 #bibtype=dom.xpath("//bib/@type") … … 712 711 return docinfo 713 712 714 713 714 # TODO: is this needed? 715 715 def getNameFromIndexMeta(self,path,docinfo=None,dom=None,cut=0): 716 716 """gets name info from the index.meta file at path or given by dom""" … … 740 740 archiveName = None 741 741 742 archiveName = getText FromNode(dom.find("name"))742 archiveName = getText(dom.find("name")) 743 743 if not archiveName: 744 744 logging.warning("documentViewer (getdocinfofromtexttool) resource/name missing in: %s" % (url)) 745 745 746 archivePath = getText FromNode(dom.find("archive-path"))746 archivePath = getText(dom.find("archive-path")) 747 747 if archivePath: 748 748 # clean up archive path … … 808 808 presentationUrl = getText(dom.find(".//texttool/presentation")) 809 809 docinfo = self.getBibinfoFromIndexMeta(url, docinfo=docinfo, dom=dom) # get info von bib tag 810 # TODO: is this needed here? 810 811 docinfo = self.getNameFromIndexMeta(url, docinfo=docinfo, dom=dom) 811 812 … … 831 832 """ 832 833 dom=self.getPresentationInfoXML(url) 833 try: 834 docinfo['author']=getText(dom.find(".//author")) 835 except: 836 pass 837 try: 838 docinfo['title']=getText(dom.find(".//title")) 839 except: 840 pass 841 try: 842 docinfo['year']=getText(dom.find(".//date")) 843 except: 844 pass 834 docinfo['author']=getText(dom.find(".//author")) 835 docinfo['title']=getText(dom.find(".//title")) 836 docinfo['year']=getText(dom.find(".//date")) 845 837 return docinfo 846 838
Note: See TracChangeset
for help on using the changeset viewer.