Changeset 618:54d3498a6e78 in documentViewer


Ignore:
Timestamp:
Jul 23, 2014, 3:51:15 PM (10 years ago)
Author:
casties
Branch:
default
Parents:
617:7aefbddddaf9 (diff), 615:d6eca930a534 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge

File:
1 edited

Legend:

Unmodified
Added
Removed
  • documentViewer.py

    r615 r618  
    2222def getMDText(node):
    2323    """returns the @text content from the MetaDataProvider metadata node"""
     24
     25   
     26
    2427    if isinstance(node, dict):
    2528        return node.get('@text', None)
    2629   
     30    if isinstance(node,list): #more than one text file if there is an attribute don't choose it
     31        for nodeInList in node:
     32            attr = nodeInList.get("@attr",None)
     33            if attr is None:
     34                return node.get('@text',None)
     35        return None
     36
     37
     38
    2739    return node
    2840
     
    256268            logging.error("template folder missing!")
    257269            return "ERROR: template folder missing!"
    258            
     270       
     271       
     272
    259273        if not getattr(self, 'digilibBaseUrl', None):
    260274            self.digilibBaseUrl = self.findDigilibUrl() or "http://digilib.mpiwg-berlin.mpg.de/digitallibrary"
     
    751765        # old style text URL
    752766        textUrl = getMDText(texttool.get('text', None))
     767
     768       
     769
     770
    753771        if textUrl and docPath:
    754772            if urlparse.urlparse(textUrl)[0] == "": #keine url
Note: See TracChangeset for help on using the changeset viewer.