Mercurial > hg > documentViewer
comparison MpiwgXmlTextServer.py @ 570:61d53ccbdd70
more resilience to server errors.
author | casties |
---|---|
date | Fri, 12 Oct 2012 16:01:41 +0200 |
parents | 694935574177 |
children | 51800c42bcda |
comparison
equal
deleted
inserted
replaced
569:be21250420be | 570:61d53ccbdd70 |
---|---|
257 # text is default mode | 257 # text is default mode |
258 textmode = 'text' | 258 textmode = 'text' |
259 textParams['mode'] = 'untokenized' | 259 textParams['mode'] = 'untokenized' |
260 textParams['outputFormat'] = 'html' | 260 textParams['outputFormat'] = 'html' |
261 | 261 |
262 # fetch the page | |
263 pagexml = self.getServerData("query/GetPage",urllib.urlencode(textParams)) | |
264 try: | 262 try: |
263 # fetch the page | |
264 pagexml = self.getServerData("query/GetPage",urllib.urlencode(textParams)) | |
265 dom = ET.fromstring(pagexml) | 265 dom = ET.fromstring(pagexml) |
266 except Exception, e: | 266 except Exception, e: |
267 logging.error("Error parsing page: %s"%e) | 267 logging.error("Error reading page: %s"%e) |
268 return None | 268 return None |
269 | 269 |
270 pagediv = None | 270 pagediv = None |
271 body = dom.find('.//body') | 271 body = dom.find('.//body') |
272 if body is None: | 272 if body is None: |