[Zope-dev] ZCatalog hackery

2001-03-01 Thread Morten W. Petersen

Hi guys,

I've got a problem with ZCatalog.  I've got plenty of large
objects, ranging from 100KB to 100MB in size.  Needless to
say, these take up a lot of processor time when indexed by
the ZCatalog.

Now, these object have to be moved from time to time, only
moved, so that one or two of the related columns and indexes
are affected (the path and the parent container id); is
there a way to go around this so that those two, the
one column and the index are updated, and not, let's say
the indexed body (which is 100KB - 100MB in size) ?

Thanks,

Morten

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] TransWarp preview release (AOP tools only)

2001-03-01 Thread Shane Hathaway

This looks very interesting, Phillip.  I haven't downloaded the package
yet, but I read the wiki and it finally made sense once I understood the
goal (I think): TW lets you set up the class inheritance hierarchy at
runtime.  In normal OO methodology, you can only extend classes.  With
TW, you can also slip your own version of a base class into a class
hierarchy (without actually modifying the Python class hierarchy, of
course.)

What is your vision of integrating AOP into a persistent object system? 
Would one drop in an object that modifies the class loading mechanism so
that the classes come from a TW component rather than Python modules?

Shane

"Phillip J. Eby" wrote:
 
 It's here...  the first preview release of TransWarp.  The bad news is, it
 only contains working versions of the aspect-oriented programming tools
 (the rest of the package is in flux).  The good news is:
 
 1. It's a *robust* working version, with 114 unit tests to prove it, and
 
 2. There's state-of-the-art documentation, including such cutting-edge
 technology as tutorials, and super-simple examples.  :)
 
 You can find the software at:
 
 http://www.zope.org/Members/pje/TransWarp/
 
 and the online documentation at:
 
 http://www.zope.org/Members/pje/Wikis/TransWarp/
 
 Comments welcome.  Enjoy.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] ZCatalog hackery

2001-03-01 Thread Morten W. Petersen

[Casey Duncan]

| Actually what I wrote assumes you are passing a Catalog not a ZCatalog.
| So you will need to change it for a ZCatalog to:

I figured that out.  :-)

There is one problem, the uids stored in the Catalog are based on the path of the
object, so I guess I'll have to make a copy of the records, and then paste it in
under the new uid (path).

-Morten

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] TransWarp preview release (AOP tools only)

2001-03-01 Thread Phillip J. Eby

At 09:37 AM 3/1/01 -0500, Shane Hathaway wrote:
This looks very interesting, Phillip.  I haven't downloaded the package
yet, but I read the wiki and it finally made sense once I understood the
goal (I think): TW lets you set up the class inheritance hierarchy at
runtime.  In normal OO methodology, you can only extend classes.  With
TW, you can also slip your own version of a base class into a class
hierarchy (without actually modifying the Python class hierarchy, of
course.)

That's a good way of describing the *function* of the AOP part of
TransWarp.  The goal is not so much to set up the inheritance hierarchy at
runtime, as to allow you to configure various versions of the same
component, and to write seperately-managed "aspects" for different areas of
concern.  The targeted time is not really "runtime" so much as "build
time".  Runtime is a side-effect of how it's done, and it can be useful for
things like selecting an OS-specific or other environment-sensitive aspect
at application startup.  But the main goals of the AOP portion are being
able to instantiate customized versions of "third-party" components, and to
be able to mix-and-match implementations for different areas of concern.
For example, wxPython vs. Tkinter vs. Win32, SQL vs LDAP vs ZODB, and so on.

TransWarp in the larger picture will also deal with generative programming;
the UML-driven parts will generate aspects that contain structural
information (inheritance, associations, aggregations, attributes, etc.)
that can then be merged with non-structural aspects.  The ability to "set
up the class inheritance hierarchy at runtime" provided by the AOP tools
will then allow you to define what an "attribute" is, and give it
publishability, security permissions, or a GUI rendering.

There is actually code in the preview release to do this structural
generation for the UML metamodel (if loaded from MMX format), and it's even
rudimentarily tested (one unit test that just makes sure it doesn't blow up
altogether) but the "StructuralModel" aspects that implement attributes and
associations are currently broken, not yet updated for the true AOP model.
Earlier versions of TransWarp did class generation as an integral part of
the GP system, not as a GP+AOP system, and I'm still adapting a lot of
stuff to take advantage of AOP and to use a cleaner metadata mechanism.


What is your vision of integrating AOP into a persistent object system? 
Would one drop in an object that modifies the class loading mechanism so
that the classes come from a TW component rather than Python modules?

Not necessary.  If you dig into the TransWarpFAQ page in the Wiki, you'll
see a question that explains how to make TW-generated classes work with
pickle and cPickle.  It just requires one additional argument at
aspect-weaving time, to specify the module which the generated classes
should be registered with.  This means that TW's AOP features are
functional right now, today, with ZODB.  (As long as the classes are
generated in good ol' Python module files.)

Now, as to whether TW will be fully compatible with Zope 3 "persistent
modules", that's a different question.  In the conversation I had with Jim
in January, based on his description of the module refresh mechanism and of
import proxies, I would say that TW-generated classes would not properly
refresh when a persistent module that they were dependent on changed.
(Because TW will generate new class objects from the imported classes
rather than referencing them via the proxy.)  But that's based on a very
early notion of how Z3 persistent modules would work.

One reason I've been racing like mad to get the preview release out is so
that, after seeing the usefulness of TW for the Zope 3 component
architecture, y'all might be interested in considering implementations for
module persistence besides proxying.  :)  IMHO, a "rollback importer"
approach ala unittest might be better suited for TW-ish components, and
have fewer weird side effects for persistent modules generally.  I don't
like unittest's mechanism for *doing* the rollback, and Zope would need a
thread-specific version of sys.modules, as well as a mechanism to purge the
cache of any objects which were loaded after any of the purged modules, but
I think the basic idea is sound.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] ZCatalog hackery

2001-03-01 Thread Casey Duncan

Casey Duncan wrote:
 
 "Morten W. Petersen" wrote:
 
  Hi guys,
 
  I've got a problem with ZCatalog.  I've got plenty of large
  objects, ranging from 100KB to 100MB in size.  Needless to
  say, these take up a lot of processor time when indexed by
  the ZCatalog.
 
  Now, these object have to be moved from time to time, only
  moved, so that one or two of the related columns and indexes
  are affected (the path and the parent container id); is
  there a way to go around this so that those two, the
  one column and the index are updated, and not, let's say
  the indexed body (which is 100KB - 100MB in size) ?
 
  Thanks,
 
  Morten
 
 
 There is no built-in way. however I see no reason that the Catalog could
 not be extended to do this with a bit of python coding.
 
 A catalog contains a collection called indexes that contains the indexes
 themselves (what else?). An External method could be written like so
 (not tested):
 
 def partialReindexObject(catalog, indexes, uid, object):
 rid = catalog.uids.get[uid]
 
 for idx_key in indexes:
 idx = catalog.indexes[idx_key].__of__(catalog)
 idx.unindex_object(rid)
 idx.index_object(rid, object, None)
 
 I think that will do it. Pass the names of the indexes as a sequence in
 indexes, and data_record_id_ as the uid.
 
 The above does not update any meta-data in the catalog.
 

Actually what I wrote assumes you are passing a Catalog not a ZCatalog.
So you will need to change it for a ZCatalog to:

 def partialReindexObject(zcatalog, indexes, uid, object):
catalog = zcatalog._catalog 
rid = catalog.uids.get[uid]
 
for idx_key in indexes:
idx = catalog.indexes[idx_key].__of__(catalog)
idx.unindex_object(rid)
idx.index_object(rid, object, None)

Sorry about that.
-- 
| Casey Duncan
| Kaivo, Inc.
| [EMAIL PROTECTED]
`--

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] How is memory shared between Zope threads?

2001-03-01 Thread Erik Stephens

Hello all,

I have noticed incosistencies between Zope threads when objects change. 
It appears that some threads see the new image of the object while
others see the old image.  Can anyone enlighten me on how Zope ensures
that all threads are seeing the same images?  Or at least point me to
the modules in the source that handle these matters?

Naively, I can think of 2 approaches: a shared memory approach or a
separate memory per thread with notifications.  Zope behaves like each
thread as its own copy of in-memory pieces and sometimes these
per/thread memory blocks do not get updated.

System info: Zope 2.1.6, Redhat 6.2, PC arch

Thanks,
Erik

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Weird Re-Indexing Errors after move to Zope 2.3.1b1

2001-03-01 Thread Chris Withers

Hi, 

Since moving one of our servers from Zope 2.2.4 to 2.3.1b1, we've been
frequently getting this weird error when trying to do something that requires an
object to be re-indexed in the Catalog:

Error Type:  AttributeError
Error Value: 'tuple' object has no attribute 'append'

Traceback:
 Traceback (innermost last):

snip

  File /usr/local/zope/cases/Products/aProduct/aProduct.py, line xxx, in
index_something
(Object: Traversable)
  File
/usr/local/zope/Zope-2.3.1b1-src/lib/python/Products/ZCatalog/ZCatalog.py, line
411, in
catalog_object
(Object: Traversable)
  File /usr/local/zope/Zope-2.3.1b1-src/lib/python/Products/ZCatalog/Catalog.py,
line 382, in
catalogObject
  File /usr/local/zope/current/lib/python/SearchIndex/UnTextIndex.py, line 394,
in index_object
  File /usr/local/zope/current/lib/python/SearchIndex/UnTextIndex.py, line 305,
in
insertReverseIndexEntry
AttributeError: 'tuple' object has no attribute 'append'

Any ideas what's going on here or how to fix it?

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Increased system CPU cycles under heavy load?

2001-03-01 Thread Erik Stephens

Hello all,

I apologize if this might be more appropriate for a Linux list.  From
our time-series graphs, we are noticing that the percentage of CPU
cycles spent on 'system' tasks grows considerably under heavy load. 
Does anyone know what kinds of operations fall under 'system'?  Task
switching, paging, these kinds of things?

When load is light, it appears that the same 1 or 2 Zope threads will
handle the requests.  As load increases, then more threads get into the
mix.  How likely is it that this increase in 'system' CPU cycles is
stemming from having to switch between the Zope threads?  Perhaps Zope
goes into a near dead-lock state and starts to spend a bunch of time
waiting for other threads to release a lock?  The reason I mention this
is that we don't notice the increased amount of 'system' CPU when the
load increases on other servers (Apache, MySQL) on other machines.

System info: Zope 2.1.6, Redhat 6.2, PC arch

Thanks,
Erik

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Weird Re-Indexing Errors after move to Zope 2.3.1b1

2001-03-01 Thread Chris McDonough

This is an artifact of a problem in the reindexing code that should be gone
in the next release.

- Original Message -
From: "Chris Withers" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 01, 2001 12:36 PM
Subject: [Zope-dev] Weird Re-Indexing Errors after move to Zope 2.3.1b1


 Hi,

 Since moving one of our servers from Zope 2.2.4 to 2.3.1b1, we've been
 frequently getting this weird error when trying to do something that
requires an
 object to be re-indexed in the Catalog:

 Error Type:  AttributeError
 Error Value: 'tuple' object has no attribute 'append'

 Traceback:
  Traceback (innermost last):

 snip

   File /usr/local/zope/cases/Products/aProduct/aProduct.py, line xxx, in
 index_something
 (Object: Traversable)
   File
 /usr/local/zope/Zope-2.3.1b1-src/lib/python/Products/ZCatalog/ZCatalog.py,
line
 411, in
 catalog_object
 (Object: Traversable)
   File
/usr/local/zope/Zope-2.3.1b1-src/lib/python/Products/ZCatalog/Catalog.py,
 line 382, in
 catalogObject
   File /usr/local/zope/current/lib/python/SearchIndex/UnTextIndex.py, line
394,
 in index_object
   File /usr/local/zope/current/lib/python/SearchIndex/UnTextIndex.py, line
305,
 in
 insertReverseIndexEntry
 AttributeError: 'tuple' object has no attribute 'append'

 Any ideas what's going on here or how to fix it?

 cheers,

 Chris

 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Weird Re-Indexing Errors after move to Zope 2.3.1b1

2001-03-01 Thread Chris Withers

 This is an artifact of a problem in the reindexing code that should be
gone
 in the next release.

Is there a workaround in the meantime? This is turning into a real
showstopper for one of NIP's most important projects right now :~(

desperately,

Chris


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Weird Re-Indexing Errors after move to Zope 2.3.1b1

2001-03-01 Thread Chris McDonough

No.  Sorry.  There should be a release of 2.3.1b2 later today.  Hint:  the
problem is caused by attempting to append to a tuple.  Converting the tuple
to a list beforehand would liekly solve the problem until you can move to a
newer release.

- Original Message -
From: "Chris Withers" [EMAIL PROTECTED]
To: "Chris McDonough" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, March 01, 2001 2:10 PM
Subject: Re: [Zope-dev] Weird Re-Indexing Errors after move to Zope 2.3.1b1


  This is an artifact of a problem in the reindexing code that should be
 gone
  in the next release.

 Is there a workaround in the meantime? This is turning into a real
 showstopper for one of NIP's most important projects right now :~(

 desperately,

 Chris




___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Weird Re-Indexing Errors after move to Zope 2.3.1b1

2001-03-01 Thread Chris McDonough

Release postponed til at least tomorrow, sorry.

- Original Message -
From: "Chris McDonough" [EMAIL PROTECTED]
To: "Chris Withers" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, March 01, 2001 2:31 PM
Subject: Re: [Zope-dev] Weird Re-Indexing Errors after move to Zope 2.3.1b1


 No.  Sorry.  There should be a release of 2.3.1b2 later today.  Hint:  the
 problem is caused by attempting to append to a tuple.  Converting the
tuple
 to a list beforehand would liekly solve the problem until you can move to
a
 newer release.

 - Original Message -
 From: "Chris Withers" [EMAIL PROTECTED]
 To: "Chris McDonough" [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Thursday, March 01, 2001 2:10 PM
 Subject: Re: [Zope-dev] Weird Re-Indexing Errors after move to Zope
2.3.1b1


   This is an artifact of a problem in the reindexing code that should be
  gone
   in the next release.
 
  Is there a workaround in the meantime? This is turning into a real
  showstopper for one of NIP's most important projects right now :~(
 
  desperately,
 
  Chris
 
 


 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] CopySupport issues

2001-03-01 Thread richard

[EMAIL PROTECTED] wrote:
 Is there a reason why the manage_main call at the end of manage_copyObjects
 and manage_cutObjects in CopySupport gets called as
 self.manage_main(REQUEST) instead of self.manage_main(self, REQUEST)? Using
 the first form, we found that the manage_main call was dying because it
 couldn't acquire various attributes and methods it needed (eg,
 manage_page_header :). The second form just makes sense...

   This has been fixed in 2.3.1 (collector patch #2006)


 In the Copy operation of manage_pasteObjects, the manage_afterClone is
 called before the object is added to its container. We'd much prefer the
 object to be both added to the container and re-got so it the
 manage_afterClone call may make use of acquired information. This is of use
 specifically for us so that the object may determine its new URL and
 catalog itself with our (Z)Catalog.

   Oddly enough, a call to getPhysicalPath() on the object works, so I can
work around this problem. Well, mostly. I'd still like to have access to
the parents - so if anyone has any hints, I'd love to hear 'em.


 Richard

-- 
Richard Jones
[EMAIL PROTECTED]
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Is ZFormulator alive?

2001-03-01 Thread erickson

ZFormulator looks like it will do some pretty neat things, but it also
looks like it is "dormant".

Does anyone use it, or know if it is compatible with Zope 2.2.x and/or
Zope 2.3?

Thanks
-paul


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Zope 2.3.0 AccessControl/SecurityInfo.py

2001-03-01 Thread Randall F. Kern

Sorry if these have already been fixed in 2.3.1, I haven't had time to
upgrade yet.

I fixed a small bug in SecurityInfo that made
SecurityInfo.setPermissionDefault() impossible to use:

191c191
 self.roles[permission_name] = rdict.keys()
---
 self.roles[permission_name] = rdict

def setPermissionDefault(self, permission_name, roles):
"""Declare default roles for a permission"""
rdict = {}
for role in roles:
rdict[role] = 1
if self.roles.get(permission_name, rdict) != rdict:
LOG('SecurityInfo', WARNING, 'Conflicting default role'
'declarations for permission "%s"' % permission_name)
self._warnings = 1
self.roles[permission_name] = rdict.keys()

My other problem was that I wanted to setup some default permissions
that are used programatically in my product (i.e. they aren't used to
protect any specific methods, but the methods themselves check for the
permission.)  A small change to ClassSecurityInfo.apply() allows you to
call SecurityInfo.setPermissionDefault() to create new permissions, even
if they aren't attached to any methods:

239a240,242
 for permission_name in self.roles.keys():
 if not ac_permissions.has_key(permission_name):
 ac_permissions[permission_name] = ()

def apply(self, classobj):
"""Apply security information to the given class object."""

dict = classobj.__dict__

# Check the class for an existing __ac_permissions__ and
# incorporate that if present to support older classes or
# classes that haven't fully switched to using SecurityInfo.
if dict.has_key('__ac_permissions__'):
for item in dict['__ac_permissions__']:
permission_name = item[0]
self._setaccess(item[1], permission_name)
if len(item)  2:
self.setDefaultRoles(permission_name, item[2])

# Set __roles__ for attributes declared public or private.
# Collect protected attribute names in ac_permissions.
ac_permissions = {}
for name, access in self.names.items():
if access in (ACCESS_PRIVATE, ACCESS_PUBLIC, ACCESS_NONE):
dict['%s__roles__' % name] = access
else:
if not ac_permissions.has_key(access):
ac_permissions[access] = []
ac_permissions[access].append(name)

# Now transform our nested dict structure into the nested tuple
# structure expected of __ac_permissions__ attributes and set
# it on the class object.
getRoles = self.roles.get
__ac_permissions__ = []
for permission_name in self.roles.keys():
if not ac_permissions.has_key(permission_name):
ac_permissions[permission_name] = ()
permissions = ac_permissions.items()
permissions.sort()
for permission_name, names in permissions:
roles = getRoles(permission_name, ())
if len(roles):
entry = (permission_name, tuple(names), tuple(roles))
else:
entry = (permission_name, tuple(names))
__ac_permissions__.append(entry)
dict['__ac_permissions__'] = tuple(__ac_permissions__)

# Take care of default attribute access policy
access = getattr(self, 'access', _marker)
if access is not _marker:
dict['__allow_access_to_unprotected_subobjects__'] = access

if getattr(self, '_warnings', None):
LOG('SecurityInfo', WARNING, 'Class "%s" had conflicting '
'security declarations' % classobj.__name__)



-Randy

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] dtml-in: next-batches

2001-03-01 Thread Brett Carter

I'm running Zope 2.2.2, and I'm trying to use the batching stuff for
the dtml-in tag, however, I can't seem to access any attributes off
the 'next-batches' or 'previous-batches' mapping object that's
supposed to be available, with the attributes 'batch-start-index',
'batch-end-index', and 'batch-size'.  However, my example code (see
below) blows up with a key error when trying to access any of these.
Is this a bug, or am I just misunderstanding how to use this thing?

I wrote an external method to dir the 'next-batches' object, and it
seems the only attributes available are:
['data', 'items', 'query_string', 'start_name_re']
-Brett

 p
dtml-in "mystuff.retseq()" size=5 start=start
 dtml-var sequence-item
/dtml-in /p
p

dtml-in "mystuff.retseq()" size=5 start=start previous
 a href="dtml-var absolute_url/batch_me?start=dtml-var 
previous-sequence-start-index"Previous/a
/dtml-in

dtml-in "mystuff.retseq()" size=5 start=start next overlap=-1
  dtml-try
dtml-in next-batches
  dtml-var batch-start-indexbr
/dtml-in
  dtml-except
   pre
   dtml-var error_typebr
   dtml-var error_valuebr
   dtml-var error_tbbr
   /pre
  /dtml-try
   
 a href="dtml-var absolute_url/batch_me?start=dtml-var 
next-sequence-start-index"Next/a
/dtml-in

/p

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] ZDebug conflicts with MailHost?

2001-03-01 Thread Itai Tavor

Hi,

On Zope 2.3.0 and 2.3.1b1, the following method produces an error 
when ZDebug is installed; If I remove ZDebug, it works fine.

dtml-sendmail mailhost=MailHost
To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
Subject: Test
This is a test
/dtml-sendmail

With ZDebug the content of the sendmail tag is ignored; sendmail.send 
is called with all arguments empty.


Traceback:

Error type: TypeError
Error value: len() of unsized object

Traceback (innermost last):
   File /opt/Zope-2.3.0-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 222, in publish_module
   File /opt/Zope-2.3.0-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 187, in publish
   File /opt/Zope-2.3.0-linux2-x86/lib/python/Zope/__init__.py, line 
221, in zpublisher_exception_hook
 (Object: ApplicationDefaultPermissions)
   File /opt/Zope-2.3.0-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 171, in publish
   File /opt/Zope-2.3.0-linux2-x86/lib/python/ZPublisher/mapply.py, 
line 160, in mapply
 (Object: mailtest)
   File /opt/Zope-2.3.0-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 112, in call_object
 (Object: mailtest)
   File /opt/Zope-2.3.0-linux2-x86/lib/python/OFS/DTMLMethod.py, line 
189, in __call__
 (Object: mailtest)
   File /opt/Zope/lib/python/Products/ZDebug/DTMLLocator.py, line 103, 
in __call__
 (Object: mailtest)
   File 
/opt/Zope-2.3.0-linux2-x86/lib/python/DocumentTemplate/DT_String.py, 
line 538, in __call__
 (Object: mailtest)
   File /opt/Zope/lib/python/Products/ZDebug/DTMLDebug.py, line 307, 
in debug_render_blocks
   File /opt/Zope/lib/python/Products/ZDebug/DTMLDebug.py, line 239, 
in debugException
 (Object: MailHost)
   File /opt/Zope/lib/python/Products/ZDebug/DTMLDebug.py, line 305, 
in debug_render_blocks
   File 
/opt/Zope-2.3.0-linux2-x86/lib/python/Products/MailHost/SendMailTag.py, 
line 188, in render
 (Object: MailHost)
   File 
/opt/Zope-2.3.0-linux2-x86/lib/python/Products/MailHost/MailHost.py, 
line 222, in send
 (Object: MailHost)
   File /opt/Zope-2.3.0-linux2-x86/lib/python1.5/smtplib.py, line 465, 
in sendmail
   File /opt/Zope-2.3.0-linux2-x86/lib/python1.5/smtplib.py, line 349, in mail
   File /opt/Zope-2.3.0-linux2-x86/lib/python1.5/smtplib.py, line 118, 
in quoteaddr
   File /opt/Zope-2.3.0-linux2-x86/lib/python1.5/rfc822.py, line 451, 
in parseaddr
   File /opt/Zope-2.3.0-linux2-x86/lib/python1.5/rfc822.py, line 496, 
in getaddrlist
   File /opt/Zope-2.3.0-linux2-x86/lib/python1.5/rfc822.py, line 504, 
in getaddress
   File /opt/Zope-2.3.0-linux2-x86/lib/python1.5/rfc822.py, line 484, 
in gotonext
TypeError: (see above)
-- 
--
Itai Tavor  -- "Je sautille, donc je suis."--
[EMAIL PROTECTED]--   - Kermit the Frog --
-- --
-- "If you haven't got your health, you haven't got anything"  --


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )