--- documentViewer/documentViewer.py 2011/02/24 13:55:28 1.169 +++ documentViewer/documentViewer.py 2011/03/01 14:53:15 1.170 @@ -43,12 +43,14 @@ def getTextFromNode(nodename): 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 @@ def getHttpData(url, data=None, num_trie raise IOError("ERROR fetching HTTP data from %s: %s"%(url,errmsg)) #return None - - ## ## documentViewer class ## @@ -898,13 +898,10 @@ class documentViewer(Folder): 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'])