Mercurial > hg > documentViewer
changeset 132:39167e96e582
fixed creation of text server on __init__
author | casties |
---|---|
date | Thu, 17 Jun 2010 19:38:59 +0200 |
parents | 519439a80cd1 |
children | 40730cfbcb8e |
files | MpdlXmlTextServer.py documentViewer.py |
diffstat | 2 files changed, 10 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/MpdlXmlTextServer.py Thu Jun 17 18:48:14 2010 +0200 +++ b/MpdlXmlTextServer.py Thu Jun 17 19:38:59 2010 +0200 @@ -20,12 +20,15 @@ manage_changeMpdlXmlTextServerForm = PageTemplateFile("zpt/manage_changeMpdlXmlTextServer", globals()) - def __init__(self,id,title="",serverUrl="http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/interface/", timeout=40): + def __init__(self,id,title="",serverUrl="http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/interface/", serverName=None, timeout=40): """constructor""" self.id=id self.title=title self.timeout = timeout - self.serverUrl = serverUrl + if serverName is None: + self.serverUrl = serverUrl + else: + self.serverUrl = "http://%s/mpdl/interface/"%serverName def getHttpData(self, url, data=None):
--- a/documentViewer.py Thu Jun 17 18:48:14 2010 +0200 +++ b/documentViewer.py Thu Jun 17 19:38:59 2010 +0200 @@ -145,7 +145,7 @@ self._setObject('template',templateFolder) # old style try: import MpdlXmlTextServer - textServer = MpdlXmlTextServer(id='fulltextclient') + textServer = MpdlXmlTextServer.MpdlXmlTextServer(id='fulltextclient',serverName=textServerName) #templateFolder['fulltextclient'] = xmlRpcClient templateFolder._setObject('fulltextclient',textServer) except Exception, e: @@ -243,17 +243,16 @@ return "ERROR: template folder missing!" if not getattr(self, 'digilibBaseUrl', None): - self.digilibBaseUrl = self.findDigilibUrl() or "http://nausikaa.mpiwg-berlin.mpg.de/digitallibrary" + self.digilibBaseUrl = self.findDigilibUrl() or "http://digilib.mpiwg-berlin.mpg.de/digitallibrary" docinfo = self.getDocinfo(mode=mode,url=url) - if tocMode != "thumbs": # get table of contents docinfo = self.getToc(mode=tocMode, docinfo=docinfo) if viewMode=="auto": # automodus gewaehlt - if docinfo.has_key("textURL") or docinfo.has_key('textURLPath'): #texturl gesetzt und textViewer konfiguriert + if docinfo.has_key('textURL') or docinfo.has_key('textURLPath'): #texturl gesetzt und textViewer konfiguriert viewMode="text_dict" else: viewMode="images" @@ -267,8 +266,8 @@ ret="" if mk is None: return "" - if type(mk) is not ListType: - mk=[mk] + if type(mk) is not ListType: + mk=[mk] for m in mk: ret+="mk=%s"%m return ret