Changeset 409:f7d73ea4b38b in documentViewer


Ignore:
Timestamp:
Nov 25, 2010, 9:03:50 AM (13 years ago)
Author:
casties
Branch:
default
Message:

quick fix for broken texturlpath

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • MpdlXmlTextServer.py

    r407 r409  
    144144        """ Show all Gis Places of whole Page"""
    145145        xpath='//place'
    146         docpath = docinfo['textURLPath']
     146        docpath = docinfo.get('textURLPath',None)
     147        if not docpath:
     148            return None
     149
    147150        url = docinfo['url']
    148151        selfurl = self.absolute_url()
     
    199202    def getOrigPages (self, docinfo=None, pageinfo=None):
    200203        """Show original page """
    201         docpath = docinfo['textURLPath']
     204        docpath = docinfo.get('textURLPath',None)
     205        if not docpath:
     206            return None
     207
    202208        logging.debug ("docinfo['textURLPath']=%s"%(docinfo['textURLPath']))
    203209        #url = docinfo['url']
  • documentViewer.py

    r405 r409  
    284284       
    285285        if viewMode=="auto": # automodus gewaehlt
    286             if docinfo.has_key("textURL") or docinfo.has_key('textURLPath'): #texturl gesetzt und textViewer konfiguriert
     286            if docinfo.has_key("textURL") or docinfo.get('textURLPath',None): #texturl gesetzt und textViewer konfiguriert
    287287                viewMode="text"
    288288            else:
     
    320320           
    321321        if viewMode=="auto": # automodus gewaehlt
    322             if docinfo.has_key('textURL') or docinfo.has_key('textURLPath'): #texturl gesetzt und textViewer konfiguriert
     322            if docinfo.has_key('textURL') or docinfo.get('textURLPath',None): #texturl gesetzt und textViewer konfiguriert
    323323                viewMode="text_dict"
    324324            else:
     
    797797            logging.error("documentViewer (getdocinfo) unknown mode: %s!"%mode)
    798798            raise ValueError("Unknown mode %s! Has to be one of 'texttool','imagepath','filepath'."%(mode))
    799                        
     799               
     800        # FIXME: fake texturlpath
     801        if not docinfo.has_key('textURLPath'):
     802            docinfo['textURLPath'] = None
     803       
    800804        logging.debug("documentViewer (getdocinfo) docinfo: %s"%docinfo)
    801805        #logging.debug("documentViewer (getdocinfo) docinfo: %s"%)
Note: See TracChangeset for help on using the changeset viewer.