changeset 177:393234132abd

urllib.quote
author abukhman
date Thu, 23 Sep 2010 16:49:47 +0200
parents 0c6df37adcd1
children 3d9fd9dba38a
files MpdlXmlTextServer.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Thu Sep 23 16:34:26 2010 +0200
+++ b/MpdlXmlTextServer.py	Thu Sep 23 16:49:47 2010 +0200
@@ -56,7 +56,7 @@
         tocPN = pageinfo['tocPN']
         selfurl = self.absolute_url()
         
-        data = self.getServerData("doc-query.xql","document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&sn=%s&viewMode=%s&highlightQuery=%s"%(docpath, 'text', queryType, url_quote(query), pagesize, pn, sn, viewMode,highlightQuery))
+        data = self.getServerData("doc-query.xql","document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&sn=%s&viewMode=%s&highlightQuery=%s"%(docpath, 'text', queryType, urllib.quote(query), pagesize, pn, sn, viewMode,highlightQuery))
         #page=self.template.fulltextclient.eval("/mpdl/interface/doc-query.xql","document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&sn=%s&viewMode=%s&highlightQuery=%s"%(docpath, 'text', queryType, query, pagesize, pn, sn, viewMode,highlightQuery) ,outputUnicode=False)                
         
         pagexml = data.replace('?document=%s'%str(docpath),'?url=%s'%url)
@@ -72,7 +72,7 @@
                         href = hrefNode.nodeValue
                         if href.startswith('page-fragment.xql'):
                             selfurl = self.absolute_url()            
-                            pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s'%(viewMode,queryType,url_quote(query),pagesize,pn,tocMode,pn,tocPN))
+                            pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s'%(viewMode,queryType,urllib.quote(query),pagesize,pn,tocMode,pn,tocPN))
                             hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl)                                           
                 return serializeNode(pagenode)        
         if (queryType=="fulltextMorph"):
@@ -86,7 +86,7 @@
                         href = hrefNode.nodeValue
                         if href.startswith('page-fragment.xql'):
                             selfurl = self.absolute_url()       
-                            pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s'%(viewMode,queryType,url_quote(query),pagesize,pn,tocMode,pn,tocPN))
+                            pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s'%(viewMode,queryType,urllib.quote(query),pagesize,pn,tocMode,pn,tocPN))
                             hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl)  
                         if href.startswith('../lt/lemma.xql'):
                             hrefNode.nodeValue = href.replace('../lt/lemma.xql','%s/template/head_main_lemma_New'%(selfurl))