Hello, I'm trying to use Zope 2.4.0 and Xron 0.0.9 on win98 (I've applied the patch to change "from Globals import DateTime" into "from DateTime import DateTime") I'm getting some errors: - First, it's complaining about ambiguous names for methods, but it's just a warning - Then it's complaining that "catalog addIndex now requires bla bla bla" Here is the traceback: ------ 2001-07-26T12:23:59 PROBLEM(100) Init Ambiguous name for method of Products.Xron .XronDTMLMethod.BaseXronDTMLMethod: "manage_editForm" != "manage_editDocument" ------ 2001-07-26T12:23:59 PROBLEM(100) Init Ambiguous name for method of Products.Xron .XronDTMLMethod.BaseXronDTMLMethod: "manage_editForm" != "manage" ------ 2001-07-26T12:23:59 PROBLEM(100) Init Ambiguous name for method of Products.Xron .XronDTMLMethod.BaseXronDTMLMethod: "manage_editForm" != "manage_main" ------ 2001-07-26T12:24:03 ERROR(200) Products.Xron.Loggerr Failed to create new Schedu le Traceback (most recent call last): File "C:\Zope\lib\python\Products\Xron\__init__.py", line 65, in initialize oSchedule=Schedule.EventSchedule(id=ScheduleID, title='Scheduled Event Catal og') File "C:\Zope\lib\python\Products\Xron\Schedule.py", line 81, in __init__ self._catalog.addIndex('nextEventTime', 'FieldIndex') File "C:\Zope\lib\python\Products\ZCatalog\Catalog.py", line 348, in addIndex raise TypeError,"""Catalog addIndex now requires the index type to TypeError: Catalog addIndex now requires the index type to be resolved prior to adding; create the proper index in the caller. Traceback (innermost last): File C:\Zope\lib\python\Products\Xron\__init__.py, line 65, in initialize File C:\Zope\lib\python\Products\Xron\Schedule.py, line 81, in __init__ (Object: LockableItem) File C:\Zope\lib\python\Products\ZCatalog\Catalog.py, line 348, in addIndex TypeError: Catalog addIndex now requires the index type to be resolved prior to adding; create the proper index in the caller. Traceback (most recent call last): File "C:\Zope\lib\python\Products\Xron\__init__.py", line 76, in initialize assert Schedule is not None AssertionError ------ I've seen messages from users saying that Xron with the patch worked fine for them with Zope 2.4.0. So why doesn't it work for me ? Thanks. Rémi. _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
I'm trying to use Zope 2.4.0 and Xron 0.0.9 on win98 (I've applied the patch to change "from Globals import DateTime" into "from DateTime import DateTime")
[snip]
File C:\Zope\lib\python\Products\ZCatalog\Catalog.py, line 348, in addIndex TypeError: Catalog addIndex now requires the index type to be resolved prior to adding; create the proper index in the caller.
[snip]
I've seen messages from users saying that Xron with the patch worked fine for them with Zope 2.4.0. So why doesn't it work for me ?
Probably because you are creating a new Schedule Zcatalog, whereas they were using one already created in a prior version of Zope. As far as I can tell the addIndex error results from changes to Catalog.py made to support PluggableIndexes. I haven't been paying attention to this development, so I have no clue what to do to make Xron compatible with PluggableIndexes. Can anyone point me in the right direction? -- Thanks -- Loren "Xron" Stafford
Loren Stafford wrote:
I'm trying to use Zope 2.4.0 and Xron 0.0.9 on win98 (I've applied the patch to change "from Globals import DateTime" into "from DateTime import DateTime")
[snip]
File C:\Zope\lib\python\Products\ZCatalog\Catalog.py, line 348, in addIndex TypeError: Catalog addIndex now requires the index type to be resolved prior to adding; create the proper index in the caller.
[snip]
I've seen messages from users saying that Xron with the patch worked fine for them with Zope 2.4.0. So why doesn't it work for me ?
Probably because you are creating a new Schedule Zcatalog, whereas they were using one already created in a prior version of Zope.
As far as I can tell the addIndex error results from changes to Catalog.py made to support PluggableIndexes. I haven't been paying attention to this development, so I have no clue what to do to make Xron compatible with PluggableIndexes.
Can anyone point me in the right direction?
Before you might have done this: self._catalog.addIndex('name', 'FieldIndex') You now need to do this: self._catalog.addIndex('name', UnIndex('name')) The same goes for KeywordIndex (UnKeywordIndex) and TextIndex (UnTextIndex). You'll also need from SearchIndex.UnIndex import UnIndex from SearchIndex.UnTextIndex import UnTextIndex from SearchIndex.UnKeywordIndex import UnKeywordIndex in there somewhere. I patched tracked to adapt to either the old or new styles: field_indexes=('type', 'numid', 'exemptions', 'date', 'stage', 'priority', 'requester', 'from', 'private') keyword_indexes=('issueOwners','subscribers','traitVals') text_indexes=('text_content',) addIndex=self._catalog.addIndex # try to add indexes in Zope 2.3 style. If this fails # then add them in Zope 2.4 style try: for name in field_indexes: addIndex(name, 'FieldIndex') for name in keyword_indexes: addIndex(name, 'KeywordIndex') for name in text_indexes: addIndex(name, 'TextIndex') except TypeError: from SearchIndex.UnIndex import UnIndex from SearchIndex.UnTextIndex import UnTextIndex from SearchIndex.UnKeywordIndex import UnKeywordIndex for name in field_indexes: addIndex(name, UnIndex(name)) for name in keyword_indexes: addIndex(name, UnKeywordIndex(name)) for name in text_indexes: addIndex(name, UnTextIndex(name)) -- Steve Alexander Software Engineer Cat-Box limited
Steve Alexander wrote:
from SearchIndex.UnIndex import UnIndex from SearchIndex.UnTextIndex import UnTextIndex from SearchIndex.UnKeywordIndex import UnKeywordIndex
I'm not sure this is a good idea. I think you're supposed to do something like: from Products.PluginIndexes.FieldIndex.FieldIndex import FieldIndex ...and use that in addIndex. cheers, Chris
Thanks Steve and Chris, If someone wants to try this out, the patches should go in the Schedule.py module of Xron. There are two calls to addIndex() in the __init__ method. I don't have 2.4.0 running yet and probably won't for awhile; so, good luck. I'm also including Chris' follow-up at the end so everything is in one message. -- Loren
-----Original Message----- From: zope-dev-admin@zope.org [mailto:zope-dev-admin@zope.org]On Behalf Of Steve Alexander Sent: Thursday, July 26, 2001 12:44 To: Loren Stafford Cc: Remi Delon; zope-dev@zope.org Subject: Re: [Zope-dev] Xron and Zope 2.4.0 again
Before you might have done this:
self._catalog.addIndex('name', 'FieldIndex')
You now need to do this:
self._catalog.addIndex('name', UnIndex('name'))
The same goes for KeywordIndex (UnKeywordIndex) and TextIndex (UnTextIndex).
You'll also need
from SearchIndex.UnIndex import UnIndex from SearchIndex.UnTextIndex import UnTextIndex from SearchIndex.UnKeywordIndex import UnKeywordIndex
in there somewhere.
I patched tracked to adapt to either the old or new styles:
field_indexes=('type', 'numid', 'exemptions', 'date', 'stage', 'priority', 'requester', 'from', 'private') keyword_indexes=('issueOwners','subscribers','traitVals') text_indexes=('text_content',) addIndex=self._catalog.addIndex # try to add indexes in Zope 2.3 style. If this fails # then add them in Zope 2.4 style try: for name in field_indexes: addIndex(name, 'FieldIndex') for name in keyword_indexes: addIndex(name, 'KeywordIndex') for name in text_indexes: addIndex(name, 'TextIndex') except TypeError: from SearchIndex.UnIndex import UnIndex from SearchIndex.UnTextIndex import UnTextIndex from SearchIndex.UnKeywordIndex import UnKeywordIndex
for name in field_indexes: addIndex(name, UnIndex(name)) for name in keyword_indexes: addIndex(name, UnKeywordIndex(name)) for name in text_indexes: addIndex(name, UnTextIndex(name))
-- Steve Alexander Software Engineer Cat-Box limited
=========================================================================
-----Original Message----- From: zope-dev-admin@zope.org [mailto:zope-dev-admin@zope.org]On Behalf Of Chris Withers Sent: Thursday, July 26, 2001 12:53 To: Steve Alexander Cc: Loren Stafford; Remi Delon; zope-dev@zope.org Subject: Re: [Zope-dev] Xron and Zope 2.4.0 again
Steve Alexander wrote:
from SearchIndex.UnIndex import UnIndex from SearchIndex.UnTextIndex import UnTextIndex from SearchIndex.UnKeywordIndex import UnKeywordIndex
I'm not sure this is a good idea.
I think you're supposed to do something like:
from Products.PluginIndexes.FieldIndex.FieldIndex import FieldIndex
...and use that in addIndex.
cheers,
Chris
o.k. I tried patching Schedule.py like this (Win2k, Zope2.4.0): def __init__(self, id='Schedule', title='Scheduled Event Catalog'): self.id = id self.title = title self.threshold = 1000 self._v_total = 0 self._catalog = ZCatalog.Catalog() from Products.PluginIndexes.FieldIndex.FieldIndex import FieldIndex field_indexes=('type', 'numid', 'exemptions', 'date', 'stage', 'priority', 'requester', 'from', 'private') keyword_indexes=('issueOwners','subscribers','traitVals') text_indexes=('text_content',) addIndex=self._catalog.addIndex for name in field_indexes: addIndex(name, FieldIndex(name)) for name in keyword_indexes: addIndex(name, FieldIndex(name)) for name in text_indexes: addIndex(name, FieldIndex(name)) self._catalog.addColumn('id') self._catalog.addColumn('meta_type') self._catalog.addColumn('nextEventTime') #self._catalog.addIndex('nextEventTime', 'FieldIndex') self._catalog.addColumn('absolute_url') #self._catalog.addIndex('absolute_url', 'FieldIndex') and got this error: ------ 2001-07-27T00:01:06 PROBLEM(100) Init Ambiguous name for method of Products.Xron.XronDTMLMethod.BaseXronDTMLMethod: "manage_editForm" != "manage_editDocument" ------ 2001-07-27T00:01:06 PROBLEM(100) Init Ambiguous name for method of Products.Xron.XronDTMLMethod.BaseXronDTMLMethod: "manage_editForm" != "manage" ------ 2001-07-27T00:01:06 PROBLEM(100) Init Ambiguous name for method of Products.Xron.XronDTMLMethod.BaseXronDTMLMethod: "manage_editForm" != "manage_main" ------ 2001-07-27T00:01:07 (302) Products.Xron.Loggerr Cannot access catalog. Suspending operation. Traceback (most recent call last): File "C:\Program Files\Metrics2-4-0\lib\python\Products\Xron\Dispatcher.py", line 62, in Timer (atime, aurl)=Schedule.armed_event() # Get next armed event File "C:\Program Files\Metrics2-4-0\lib\python\Products\Xron\Schedule.py", line 125, in armed_event sort_on='nextEventTime' File "C:\PROGRA~1\METRIC~2\lib\python\Products\ZCatalog\Catalog.py", line 658, in searchResults used=self._indexedSearch(kw, sort_index, r.append, used) File "C:\PROGRA~1\METRIC~2\lib\python\Products\ZCatalog\Catalog.py", line 538, in _indexedSearch index = self.indexes[i].__of__(self) TypeError: unbound C method must be called with Acquirer 1st argument Traceback (innermost last): File C:\Program Files\Metrics2-4-0\lib\python\Products\Xron\Dispatcher.py, line 62, in Timer File C:\Program Files\Metrics2-4-0\lib\python\Products\Xron\Schedule.py, line 125, in armed_event (Object: LockableItem) File C:\PROGRA~1\METRIC~2\lib\python\Products\ZCatalog\Catalog.py, line 658, in searchResults File C:\PROGRA~1\METRIC~2\lib\python\Products\ZCatalog\Catalog.py, line 538, in _indexedSearch TypeError: unbound C method must be called with Acquirer 1st argument ------ 2001-07-27T00:01:07 PROBLEM(100) Products.Xron.Loggerr Dispatcher thread is terminating.
I think you have to tailor Steve's patch a little more. Try something like this (untested): def __init__(self, id='Schedule', title='Scheduled Event Catalog'): self.id = id self.title = title self.threshold = 1000 self._v_total = 0 self._catalog = ZCatalog.Catalog() self._catalog.addColumn('id') self._catalog.addColumn('meta_type') self._catalog.addColumn('nextEventTime') self._catalog.addColumn('absolute_url') self._catalog.addIndex('nextEventTime', UnIndex('nextEventTime')) self._catalog.addIndex('absolute_url', UnIndex('absolute_url')) -- Loren
-----Original Message----- From: Walter Miller [mailto:wmiller@mediaone.net] Sent: Thursday, July 26, 2001 17:32 To: Loren Stafford; zope-dev@zope.org Cc: Remi Delon; Steve Alexander Subject: Re: [Zope-dev] Xron and Zope 2.4.0 again
o.k. I tried patching Schedule.py like this (Win2k, Zope2.4.0):
[snip]
and got this error:
[snip]
File C:\PROGRA~1\METRIC~2\lib\python\Products\ZCatalog\Catalog.py, line 538, in _indexedSearch TypeError: unbound C method must be called with Acquirer 1st argument
participants (5)
-
Chris Withers -
Loren Stafford -
Remi Delon -
Steve Alexander -
Walter Miller