Re: [Zope] dtml method contents

2007-08-30 Thread garry saddington
On Thu, 2007-08-30 at 19:31 +0100, garry saddington wrote:
> On Thu, 2007-08-30 at 18:44 +0100, Peter Bengtsson wrote:
> > 
> > garry saddington wrote:
> > > I found this method on Zopelabs to get the contents of all ZSQL methods.
> > > 
> > >  > > Method'], search_sub=1)">
> > >   &dtml.-id; (&dtml.-title_or_id;)
> > >   
> > >   
> > >  
> > > 
> > > 
> > > Is it possible to do the same with all dtml methods? I have tried
> > > replacing "template" with "document_src" but this gives a mixture of
> > > part rendered methods and error messages which is completely jumbled.
> > Have you tried  instead of  > "document_src">?
It seems the  tag was not doing enough to stop the browser from
rendering all the code. Replacing with  has worked!
Regards
Garry
> > > ___
> > > Zope maillist  -  Zope@zope.org
> > > http://mail.zope.org/mailman/listinfo/zope
> > > **   No cross posts or HTML encoding!  **
> > > (Related lists - 
> > >  http://mail.zope.org/mailman/listinfo/zope-announce
> > >  http://mail.zope.org/mailman/listinfo/zope-dev )
> > > 
> > 
> 
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] dtml method contents

2007-08-30 Thread Dieter Maurer
garry saddington wrote at 2007-8-30 15:46 +0100:
>I found this method on Zopelabs to get the contents of all ZSQL methods.
>
>Method'], search_sub=1)">
>  &dtml.-id; (&dtml.-title_or_id;)
>  
>  
> 
>
>
>Is it possible to do the same with all dtml methods? I have tried
>replacing "template" with "document_src" but this gives a mixture of
>part rendered methods and error messages which is completely jumbled.

What is the "." in "&dtml.-"? In may memory, the "." where
somewhere else (but I do not use DTML for a long time).

Anyway:

  Use the "prefix" attribute of "dtml-in" and replace your
  "template" above with "_item".

  ATT: keep the "..." around; otherwise, the errors will stay.



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Calling a ZPT macro, with parameters, from a python script

2007-08-30 Thread Dieter Maurer
Sean F wrote at 2007-8-29 11:58 -0700:
>Is there a way to call a specific macro in a ZPT from a python script?
>
>So far, the only way I've found to do this is by calling the macro template
>from another template, then calling the wrapper, like:
>
>wrapper:
>  use-macro="python:path('here/my_macros/macros/'+options['macro'])" />
>
>script:
>context.my_wrapper(macro='my_macro',foo='whatever')
>
>Is there a way to do this without wrapping the macro template in another
>template call?

I doubt that you can do this in untrusted code.

To call a macro, the caller must provide some context (note
that a macro is usually used inside a template and this
template provides a namespace for variables and ways to handle
slots assignments). I would be very surprised if you could
build the context objects in untrusted code.



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] dtml method contents

2007-08-30 Thread garry saddington
On Thu, 2007-08-30 at 18:44 +0100, Peter Bengtsson wrote:
> 
> garry saddington wrote:
> > I found this method on Zopelabs to get the contents of all ZSQL methods.
> > 
> >  > Method'], search_sub=1)">
> >   &dtml.-id; (&dtml.-title_or_id;)
> >   
> >   
> >  
> > 
> > 
> > Is it possible to do the same with all dtml methods? I have tried
> > replacing "template" with "document_src" but this gives a mixture of
> > part rendered methods and error messages which is completely jumbled.
> Have you tried  instead of  "document_src">?
Yes, same result I'm afraid.
Garry
> 
> > Regards
> > Garry
> > 
> > ___
> > Zope maillist  -  Zope@zope.org
> > http://mail.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists - 
> >  http://mail.zope.org/mailman/listinfo/zope-announce
> >  http://mail.zope.org/mailman/listinfo/zope-dev )
> > 
> 

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] UTF encoding problem w/ ZPT's (No, not the usual :)

2007-08-30 Thread Doyon, Jean-Francois
Yes, it's Zope 2.10.4 with CMF 2.1.0, all of them on Python 2.4.4, all
of them on CentOS 4.4 (or maybe .5 now?) (maybe not at exactly the same
patch/upgrade level, but the python is custom built).  In fact the
entire product list is exactly the same!

OK, so I think maybe my devel machine is CentOS 4.4, and the production
systems are CentOS 4.5, but that's as much difference as there might be,
worst case scenario.  I have a hard time picturing this making much of a
difference in the PT encoding though :P

*scratches head*

J.F.

-Original Message-
From: Maciej Wisniowski [mailto:[EMAIL PROTECTED] 
Sent: August 30, 2007 08:49
To: Doyon, Jean-Francois
Cc: Chris Withers; zope@zope.org
Subject: Re: [Zope] UTF encoding problem w/ ZPT's (No, not the usual :)


> As for subversion, I took great care to make sure everything was utf-8

> on the FS, during development, and I know Subersion uses utf-8 
> internally, so I'm not sure what it would change it to.  Once checked 
> back out, it still looks like utf-8 ... I'm saying all this based on 
> the assumption that the string -> unicode difference might come from 
> the encoding of the PT itself?
>   
Which Zope version do you have and are you sure your versions are same
in both environments?

--
Maciej Wisniowski
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] dtml method contents

2007-08-30 Thread Peter Bengtsson



garry saddington wrote:

I found this method on Zopelabs to get the contents of all ZSQL methods.


  &dtml.-id; (&dtml.-title_or_id;)
  
  
 



Is it possible to do the same with all dtml methods? I have tried
replacing "template" with "document_src" but this gives a mixture of
part rendered methods and error messages which is completely jumbled.
Have you tried  instead of "document_src">?



Regards
Garry

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce

 http://mail.zope.org/mailman/listinfo/zope-dev )



--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] dtml method contents

2007-08-30 Thread garry saddington
I found this method on Zopelabs to get the contents of all ZSQL methods.


  &dtml.-id; (&dtml.-title_or_id;)
  
  
 


Is it possible to do the same with all dtml methods? I have tried
replacing "template" with "document_src" but this gives a mixture of
part rendered methods and error messages which is completely jumbled.
Regards
Garry

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] UTF encoding problem w/ ZPT's (No, not the usual :)

2007-08-30 Thread Maciej Wisniowski

> As for subversion, I took great care to make sure everything was utf-8
> on the FS, during development, and I know Subersion uses utf-8
> internally, so I'm not sure what it would change it to.  Once checked
> back out, it still looks like utf-8 ... I'm saying all this based on the
> assumption that the string -> unicode difference might come from the
> encoding of the PT itself?
>   
Which Zope version do you have and are you sure your
versions are same in both environments?

-- 
Maciej Wisniowski
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] UTF encoding problem w/ ZPT's (No, not the usual :)

2007-08-30 Thread Doyon, Jean-Francois
Ooops, my bad ...

Here it is:

Traceback (innermost last):
  Module ZPublisher.Publish, line 119, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module Products.CMFCore.FSPageTemplate, line 216, in _exec
  Module Products.CMFCore.FSPageTemplate, line 155, in pt_render
  Module Products.PageTemplates.PageTemplate, line 89, in pt_render
  Module zope.pagetemplate.pagetemplate, line 117, in pt_render
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 379, in do_startEndTag
  Module zope.tal.talinterpreter, line 408, in do_startTag
  Module zope.tal.talinterpreter, line 496, in attrAction_tal
  Module Products.ESSPortals.i18ntargetpatch, line 34, in
talinterpretertranslate
  Module Products.ESSPortals.i18ntargetpatch, line 14, in
zopecontexttranslate
  Module Products.PageTemplates.Expressions, line 224, in evaluateText
  Module zope.tales.tales, line 696, in evaluate
   - URL:
file:/home/atlas/app/Zope-CPS-Instance/Products/ESSPortals/skins/atlas/s
plash/root_view.pt
   - Line 33, Column 0
   - Expression: u'string:fr'
   - Names:
  {'container': ,
   'context': ,
   'default': ,
   'here': ,
   'loop': {},
   'nothing': None,
   'options': {'args': ()},
   'repeat': ,
   'request': http://atlas.nrcan.gc.ca/new/root_view>,
   'root': ,
   'template': ,
   'traverse_subpath': [],
   'user': }
TypeError: 'unicode' object is not callable

The problem is that zope.tales.tales.evaluate() tests for a str ... But,
now, for unknown reasons, it's getting a unicode string.

The i18ntarget patch code does nothing to the value of the i18n:target
attribute.  Up until yesterday, target_language was always a string ...
Now, on the new servers, it's a unicode string! (And like I said, the
environments are otherwise quite identical).

Here's the monkey patch to enable i18n:target support:

# $Id: i18ntargetpatch.py 2481 2007-08-29 17:24:02Z jdoyon $

""" Make i18n:target function in ZPT's. """

from Products.PageTemplates.Expressions import ZopeContext
from Products.PageTemplates.GlobalTranslationService import \
 getGlobalTranslationService
from zope.tal.talinterpreter import TALInterpreter

def zopecontexttranslate(self, msgid, domain=None, mapping=None,
 target_language=None, default=None):
context = self.contexts.get('context')
if target_language:
target_language = self.evaluateText(target_language)
return getGlobalTranslationService().translate(
domain, msgid, mapping=mapping,
context=context, target_language=target_language,
default=default)

ZopeContext.translate = zopecontexttranslate

def talinterpretertranslate(self, msgid, default=None, i18ndict=None,
obj=None, domain=None):
if default is None:
default = getattr(msgid, 'default', unicode(msgid))
if i18ndict is None:
i18ndict = {}
if domain is None:
domain = getattr(msgid, 'domain', self.i18nContext.domain)
if obj:
i18ndict.update(obj)
if not self.i18nInterpolate:
return msgid
return self.engine.translate(msgid, self.i18nContext.domain,
 i18ndict, self.i18nContext.target,
default)

TALInterpreter.translate = talinterpretertranslate


We'll see with time if this crops up anywhere else ... Though I use
i18n:target in very few places, and don't usually otherwise handle
attribute values directly the way I do here.

As for subversion, I took great care to make sure everything was utf-8
on the FS, during development, and I know Subersion uses utf-8
internally, so I'm not sure what it would change it to.  Once checked
back out, it still looks like utf-8 ... I'm saying all this based on the
assumption that the string -> unicode difference might come from the
encoding of the PT itself?

J.F.
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Chris Withers
Sent: August 30, 2007 06:45
To: Doyon, Jean-Francois
Cc: zope@zope.org
Subject: Re: [Zope] UTF encoding problem w/ ZPT's (No, not the usual :)

Doyon, Jean-Francois wrote:
> So I see this:
> 
> Error Type: TypeError
> Error Value: 'unicode' object is not callable

Usual comments, full traceback please. This doesn't look like a normal
encoding error but a bug in code somewhere...

> The only difference I can see is that the file went through subversion
in the process (commit -> check out on different machine).

Subversion will likely screw with the encoding ;-)

cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http:/

Re: [Zope] UTF encoding problem w/ ZPT's (No, not the usual :)

2007-08-30 Thread Chris Withers

Doyon, Jean-Francois wrote:

So I see this:

Error Type: TypeError
Error Value: 'unicode' object is not callable


Usual comments, full traceback please. This doesn't look like a normal 
encoding error but a bug in code somewhere...



The only difference I can see is that the file went through subversion in the 
process (commit -> check out on different machine).


Subversion will likely screw with the encoding ;-)

cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] how to fill form values name:int in javascript?

2007-08-30 Thread Peter Bengtsson



Jaroslav Lukesh wrote:

Hi,
 
This is typically not zope question, but I does not find solution for 
this zopiness. I need to fill from javascript form fields with defined 
zope type:
 

 
and how to address it in javascript? This make JS error for me:
 
document.forms['form_name'].number:int.value =1;

like this:
document.forms['form_name']['number:int'].value =1;

--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] ZopeTestCase.installProduct('TextIndexNG3') trouble

2007-08-30 Thread Peter Bengtsson
I added a installProduct('Five') first and got a little further. Now a 
different traceback:



[EMAIL PROTECTED]:~/GreenBible/tests $ ./run_testSearch.sh
SOFTWARE_HOME: /home/peterbe/zope/zope289/lib/python
INSTANCE_HOME: /home/peterbe/zope/zope289
Loading Zope, please stand by ... done (0.369s)
Installing ZPsycopgDA ... done (0.019s)
Installing GreenBible ... done (0.325s)
Installing MailHost ... done (0.008s)
Installing ZTinyMCE ... done (0.018s)
Installing ZCatalog ... done (0.005s)
Installing ZCTextIndex ... done (0.006s)
Installing Five ... done (0.284s)
E
==
ERROR: test private method _splitSearchterm() which will
--
Traceback (most recent call last):
  File 
"/home/peterbe/zope/zope289/lib/python/Testing/ZopeTestCase/profiler.py", 
line 98, in __call__

testMethod()
  File "testSearch.py", line 29, in test_splitSearchTerm
site = self._setUpSite()
  File "classes.py", line 82, in _setUpSite
dispatcher.manage_addSite('gb', initialize=bool(initialize))
  File "/home/peterbe/zope/zope289/Products/GreenBible/Site.py", line 
68, in manage_addSite

object._init()
  File "/home/peterbe/zope/zope289/Products/GreenBible/Management.py", 
line 89, in _init

self._setupZCatalog()
  File "/home/peterbe/zope/zope289/Products/GreenBible/Management.py", 
line 173, in _setupZCatalog

adder(idx, extras)
  File 
"/home/peterbe/zope/zope289/Products/TextIndexNG3/TextIndexNG3.py", line 
164, in manage_addTextIndexNG3

REQUEST=REQUEST, RESPONSE=RESPONSE, URL1=URL3)
  File 
"/home/peterbe/zope/zope289/lib/python/Products/ZCatalog/ZCatalog.py", 
line 413, in manage_addIndex

self.addIndex(name, type,extra)
  File 
"/home/peterbe/zope/zope289/lib/python/Products/ZCatalog/ZCatalog.py", 
line 1007, in addIndex

index = base(name, extra=extra, caller=self)
  File 
"/home/peterbe/zope/zope289/Products/TextIndexNG3/TextIndexNG3.py", line 
78, in __init__

ranking=bool(get(extra, 'ranking')),
  File 
"/home/peterbe/zope/zope289/Products/TextIndexNG3/src/textindexng/index.py", 
line 48, in __init__

self.clear()
  File 
"/home/peterbe/zope/zope289/Products/TextIndexNG3/src/textindexng/index.py", 
line 54, in clear

self._lexicon = zapi.createObject(None, self.lexicon, self.languages)
  File 
"/home/peterbe/zope/zope289/lib/python/zope/component/__init__.py", line 
184, in createObject

return getUtility(IFactory, name, context)(*args, **kwargs)
  File 
"/home/peterbe/zope/zope289/lib/python/zope/component/__init__.py", line 
76, in getUtility
return getService(Utilities, context=context).getUtility(interface, 
name)
  File 
"/home/peterbe/zope/zope289/lib/python/zope/component/utility.py", line 
44, in getUtility

raise ComponentLookupError(interface, name)
ComponentLookupError: (zope.component.interfaces.IFactory>, 'txng.lexicons.default')





Andreas Jung wrote:



--On 30. August 2007 10:04:14 +0100 Peter Bengtsson <[EMAIL PROTECTED]> 
wrote:



I'm having trouble installing TextIndexNG 3.1.6 in my zope unit test.
Here's the output:

[EMAIL PROTECTED]:~/GreenBible/tests $ ./run_testSearch.sh
SOFTWARE_HOME: /home/peterbe/zope/zope289/lib/python
INSTANCE_HOME: /home/peterbe/zope/zope289
Loading Zope, please stand by ... done (0.395s)
Installing ZPsycopgDA ... done (0.020s)
Installing GreenBible ... done (0.331s)
Installing MailHost ... done (0.009s)
Installing ZTinyMCE ... done (0.018s)
Installing ZCatalog ... done (0.006s)
Installing ZCTextIndex ... done (0.005s)
E
==
ERROR: test private method _splitSearchterm() which will
--
Traceback (most recent call last):
   File
"/home/peterbe/zope/zope289/lib/python/Testing/ZopeTestCase/profiler.py",
line 98, in __call__
 testMethod()
   File "testSearch.py", line 29, in test_splitSearchTerm
 site = self._setUpSite()
   File "classes.py", line 81, in _setUpSite
 dispatcher.manage_addSite('gb', initialize=bool(initialize))
   File "/home/peterbe/zope/zope289/Products/GreenBible/Site.py", line
68, in manage_addSite
 object._init()
   File "/home/peterbe/zope/zope289/Products/GreenBible/Management.py",
line 89, in _init
 self._setupZCatalog()
   File "/home/peterbe/zope/zope289/Products/GreenBible/Management.py",
line 173, in _setupZCatalog
 adder(idx, extras)
   File
"/home/peterbe/zope/zope289/Products/TextIndexNG3/TextIndexNG3.py", line
164, in manage_addTextIndexNG3
 REQUEST=REQUEST, RESPONSE=RESPONSE, URL1=URL3)
   File
"/home/peterbe/zope/zope289/lib/python/Products/ZCatalog/ZCatalog.py",
line 413, in manage_addIndex
 self.addIndex(name, type,extra)
   File
"/home/peterbe/zope/zope289/lib/python/Products/ZCatalog/ZCatalog.py",
line 1007, in addIndex
 index = base(name, extra=extra, caller=self)
   File
"/home/peterbe/zope/

Re: [Zope] ZopeTestCase.installProduct('TextIndexNG3') trouble

2007-08-30 Thread Andreas Jung



--On 30. August 2007 10:04:14 +0100 Peter Bengtsson <[EMAIL PROTECTED]> 
wrote:



I'm having trouble installing TextIndexNG 3.1.6 in my zope unit test.
Here's the output:

[EMAIL PROTECTED]:~/GreenBible/tests $ ./run_testSearch.sh
SOFTWARE_HOME: /home/peterbe/zope/zope289/lib/python
INSTANCE_HOME: /home/peterbe/zope/zope289
Loading Zope, please stand by ... done (0.395s)
Installing ZPsycopgDA ... done (0.020s)
Installing GreenBible ... done (0.331s)
Installing MailHost ... done (0.009s)
Installing ZTinyMCE ... done (0.018s)
Installing ZCatalog ... done (0.006s)
Installing ZCTextIndex ... done (0.005s)
E
==
ERROR: test private method _splitSearchterm() which will
--
Traceback (most recent call last):
   File
"/home/peterbe/zope/zope289/lib/python/Testing/ZopeTestCase/profiler.py",
line 98, in __call__
 testMethod()
   File "testSearch.py", line 29, in test_splitSearchTerm
 site = self._setUpSite()
   File "classes.py", line 81, in _setUpSite
 dispatcher.manage_addSite('gb', initialize=bool(initialize))
   File "/home/peterbe/zope/zope289/Products/GreenBible/Site.py", line
68, in manage_addSite
 object._init()
   File "/home/peterbe/zope/zope289/Products/GreenBible/Management.py",
line 89, in _init
 self._setupZCatalog()
   File "/home/peterbe/zope/zope289/Products/GreenBible/Management.py",
line 173, in _setupZCatalog
 adder(idx, extras)
   File
"/home/peterbe/zope/zope289/Products/TextIndexNG3/TextIndexNG3.py", line
164, in manage_addTextIndexNG3
 REQUEST=REQUEST, RESPONSE=RESPONSE, URL1=URL3)
   File
"/home/peterbe/zope/zope289/lib/python/Products/ZCatalog/ZCatalog.py",
line 413, in manage_addIndex
 self.addIndex(name, type,extra)
   File
"/home/peterbe/zope/zope289/lib/python/Products/ZCatalog/ZCatalog.py",
line 1007, in addIndex
 index = base(name, extra=extra, caller=self)
   File
"/home/peterbe/zope/zope289/Products/TextIndexNG3/TextIndexNG3.py", line
78, in __init__
 ranking=bool(get(extra, 'ranking')),
   File
"/home/peterbe/zope/zope289/Products/TextIndexNG3/src/textindexng/index.p
y", line 48, in __init__
 self.clear()
   File
"/home/peterbe/zope/zope289/Products/TextIndexNG3/src/textindexng/index.p
y", line 54, in clear
 self._lexicon = zapi.createObject(None, self.lexicon, self.languages)
   File
"/home/peterbe/zope/zope289/lib/python/zope/component/__init__.py", line
184, in createObject
 return getUtility(IFactory, name, context)(*args, **kwargs)
   File
"/home/peterbe/zope/zope289/lib/python/zope/component/__init__.py", line
76, in getUtility
 return getService(Utilities, context=context).getUtility(interface,
name)
   File
"/home/peterbe/zope/zope289/lib/python/zope/component/__init__.py", line
68, in getService
 return getServices(context).getService(name)
   File
"/home/peterbe/zope/zope289/lib/python/zope/component/service.py", line
109, in getService
 raise ComponentLookupError(name)
ComponentLookupError: 'Utilities'




You might check how the TXNG 3 tests for Plone were written 
(TextIndexNG3/tests/..*plone*. Looks as if the ZCML configuration did not 
work or something like that.


Andreas

pgpZpgPPZOcLp.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] ZopeTestCase.installProduct('TextIndexNG3') trouble

2007-08-30 Thread Peter Bengtsson
I'm having trouble installing TextIndexNG 3.1.6 in my zope unit test. 
Here's the output:


[EMAIL PROTECTED]:~/GreenBible/tests $ ./run_testSearch.sh
SOFTWARE_HOME: /home/peterbe/zope/zope289/lib/python
INSTANCE_HOME: /home/peterbe/zope/zope289
Loading Zope, please stand by ... done (0.395s)
Installing ZPsycopgDA ... done (0.020s)
Installing GreenBible ... done (0.331s)
Installing MailHost ... done (0.009s)
Installing ZTinyMCE ... done (0.018s)
Installing ZCatalog ... done (0.006s)
Installing ZCTextIndex ... done (0.005s)
E
==
ERROR: test private method _splitSearchterm() which will
--
Traceback (most recent call last):
  File 
"/home/peterbe/zope/zope289/lib/python/Testing/ZopeTestCase/profiler.py", 
line 98, in __call__

testMethod()
  File "testSearch.py", line 29, in test_splitSearchTerm
site = self._setUpSite()
  File "classes.py", line 81, in _setUpSite
dispatcher.manage_addSite('gb', initialize=bool(initialize))
  File "/home/peterbe/zope/zope289/Products/GreenBible/Site.py", line 
68, in manage_addSite

object._init()
  File "/home/peterbe/zope/zope289/Products/GreenBible/Management.py", 
line 89, in _init

self._setupZCatalog()
  File "/home/peterbe/zope/zope289/Products/GreenBible/Management.py", 
line 173, in _setupZCatalog

adder(idx, extras)
  File 
"/home/peterbe/zope/zope289/Products/TextIndexNG3/TextIndexNG3.py", line 
164, in manage_addTextIndexNG3

REQUEST=REQUEST, RESPONSE=RESPONSE, URL1=URL3)
  File 
"/home/peterbe/zope/zope289/lib/python/Products/ZCatalog/ZCatalog.py", 
line 413, in manage_addIndex

self.addIndex(name, type,extra)
  File 
"/home/peterbe/zope/zope289/lib/python/Products/ZCatalog/ZCatalog.py", 
line 1007, in addIndex

index = base(name, extra=extra, caller=self)
  File 
"/home/peterbe/zope/zope289/Products/TextIndexNG3/TextIndexNG3.py", line 
78, in __init__

ranking=bool(get(extra, 'ranking')),
  File 
"/home/peterbe/zope/zope289/Products/TextIndexNG3/src/textindexng/index.py", 
line 48, in __init__

self.clear()
  File 
"/home/peterbe/zope/zope289/Products/TextIndexNG3/src/textindexng/index.py", 
line 54, in clear

self._lexicon = zapi.createObject(None, self.lexicon, self.languages)
  File 
"/home/peterbe/zope/zope289/lib/python/zope/component/__init__.py", line 
184, in createObject

return getUtility(IFactory, name, context)(*args, **kwargs)
  File 
"/home/peterbe/zope/zope289/lib/python/zope/component/__init__.py", line 
76, in getUtility
return getService(Utilities, context=context).getUtility(interface, 
name)
  File 
"/home/peterbe/zope/zope289/lib/python/zope/component/__init__.py", line 
68, in getService

return getServices(context).getService(name)
  File 
"/home/peterbe/zope/zope289/lib/python/zope/component/service.py", line 
109, in getService

raise ComponentLookupError(name)
ComponentLookupError: 'Utilities'


--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )