changeset 134:6a33aa624ba4

fixed more oopsies
author casties
date Fri, 18 Jun 2010 16:08:46 +0200
parents 40730cfbcb8e
children 123248b3bb34
files MpdlXmlTextServer.py documentViewer.py
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Thu Jun 17 20:34:36 2010 +0200
+++ b/MpdlXmlTextServer.py	Fri Jun 18 16:08:46 2010 +0200
@@ -6,6 +6,7 @@
 
 import sys
 import logging
+import urllib
 import documentViewer
 from documentViewer import getTextFromNode, serializeNode
 
@@ -216,19 +217,19 @@
 
     def getTranslate(self, query=None, language=None):
         """translate into another languages"""
-        data = self.getServerData("lt/lex.xql","document=&language="+str(language)+"&query="+url_quote(str(query)))
+        data = self.getServerData("lt/lex.xql","document=&language="+str(language)+"&query="+urllib.quote(query))
         #pagexml=self.template.fulltextclient.eval("/mpdl/interface/lt/lex.xql","document=&language="+str(language)+"&query="+url_quote(str(query)))
         return data
     
     def getLemma(self, lemma=None, language=None):
         """simular words lemma """
-        data = self.getServerData("lt/lemma.xql","document=&language="+str(language)+"&lemma="+url_quote(str(lemma)))
+        data = self.getServerData("lt/lemma.xql","document=&language="+str(language)+"&lemma="+urllib.quote(lemma))
         #pagexml=self.template.fulltextclient.eval("/mpdl/interface/lt/lemma.xql","document=&language="+str(language)+"&lemma="+url_quote(str(lemma)))
         return data
     
     def getLemmaNew(self, query=None, language=None):
         """simular words lemma """
-        data = self.getServerData("lt/lemma.xql","document=&language="+str(language)+"&lemma="+url_quote(str(query)))
+        data = self.getServerData("lt/lemma.xql","document=&language="+str(language)+"&lemma="+urllib.quote(query))
         #pagexml=self.template.fulltextclient.eval("/mpdl/interface/lt/lemma.xql","document=&language="+str(language)+"&lemma="+url_quote(str(query)))
         return data
 
--- a/documentViewer.py	Thu Jun 17 20:34:36 2010 +0200
+++ b/documentViewer.py	Fri Jun 18 16:08:46 2010 +0200
@@ -7,7 +7,7 @@
 from Globals import package_home
 
 from Ft.Xml import EMPTY_NAMESPACE, Parse
-from Ft.Xml.Domlette import PrettyPrint, Print
+import Ft.Xml.Domlette
 import os.path
 import sys
 import urllib
@@ -266,7 +266,7 @@
         ret=""
         if mk is None:
             return ""
-        if type(mk) is not ListType:
+        if not isinstance(mk, list):
             mk=[mk]
         for m in mk:
             ret+="mk=%s"%m