Mercurial > hg > documentViewer
diff documentViewer.py @ 435:94baa8dbc7e8
*** empty log message ***
author | abukhman |
---|---|
date | Tue, 01 Mar 2011 15:53:15 +0100 |
parents | 44ccb7bd0938 |
children | 0baf4e761be7 |
line wrap: on
line diff
--- a/documentViewer.py Thu Feb 24 14:55:28 2011 +0100 +++ b/documentViewer.py Tue Mar 01 15:53:15 2011 +0100 @@ -43,12 +43,14 @@ rc = rc + node.data return rc -def serializeNode(node, encoding='utf-8'): +def serializeNode(node, encoding="utf-8"): """returns a string containing node as XML""" - buf = cStringIO.StringIO() - Ft.Xml.Domlette.Print(node, stream=buf, encoding=encoding) - s = buf.getvalue() - buf.close() + stream = cStringIO.StringIO() + logging.debug("BUF: %s"%(stream)) + Ft.Xml.Domlette.PrettyPrint(node, stream=stream, encoding=encoding) + s = stream.getvalue() + logging.debug("BUF: %s"%(s)) + stream.close() return s def browserCheck(self): @@ -161,8 +163,6 @@ raise IOError("ERROR fetching HTTP data from %s: %s"%(url,errmsg)) #return None - - ## ## documentViewer class ## @@ -898,13 +898,10 @@ pageinfo['highlightQuery'] = self.REQUEST.get('highlightQuery','') pageinfo['tocPageSize'] = self.REQUEST.get('tocPageSize', '30') pageinfo['queryPageSize'] =self.REQUEST.get('queryPageSize', '10') - pageinfo['tocPN'] = self.REQUEST.get('tocPN', '1') - + pageinfo['tocPN'] = self.REQUEST.get('tocPN', '1') toc = int (pageinfo['tocPN']) pageinfo['textPages'] =int (toc) - - if 'tocSize_%s'%tocMode in docinfo: tocSize = int(docinfo['tocSize_%s'%tocMode]) tocPageSize = int(pageinfo['tocPageSize'])