Re: [Zope-dev] dtml-in batching badly

2001-06-20 Thread Michael Bernstein

seb bacon wrote:
 
 * Joachim Werner [EMAIL PROTECTED] [010618 20:28]:
   That's not the behaviour I'd expect.  Can anyone confirm this is a
   bug?
 
  As LEE Kwan Soo has already said, it is not a bug, but a clever (too
  clever?) feature that should maybe not be enabled by default. Every second
  week or so somebody runs into this and thinks it is a bug.
 
 Thanks for the hint, folks.
 
 I'm not a zope newbie, and this still bit me.  IMO there's something
 fairly wrong with the current setup.  either the default behaviour
 should be changed to orphans=0, or the visibility of default values
 for tags should be improved (from the book: orphan=int The desired
 minimum batch size - no mention of defaults).
 
 Furthermore, the 'feature' doesn't work as I'd expect.  In the example
 I posted, for the sequence (1,2,3,4), I got:
 
  batch 1: 1
  batch 2: 2 3 4
  batch 3: 3 4
  batch 4: 4
 
 This isn't in batches of at least 3... If it were iterating in minimum
 batches of 3, shouldn't that be:
 
  batch 1: 1 2 3
  batch 2: 2 3 4
  batch 3: 2 3 4
  batch 4: 2 3 4

Orphan control shouldn't actually set the desired minimum
batch size, it should set the size at or below which the
last batch should be combined with the next to last batch.

If my batch size is five, and orphan is set to three, and I
have a set of eight records that I am iterating through, I
will get a single eight record batch, because the orphan
setting tries to prevent the last batch having three or less
results by combining them with the previous five.

Orphan settings typically do not override where the batch
starts (that would be a 'widow' setting) only where it ends,
which is why you are getting increasingly smaller batches.

However, the fact that you are getting four batches (rather
than just one) is arguably a bug. A batch size of one,
combined with an orphan setting of three, should actually
give the following result:

 batch 1: 1 2 3 4

But the algorithm doesn't seem 'smart' enough to roll-up the
batches by recursing through them in reverse order. Arguably
though, you should never set your batch size smaller than
the orphan size, so this isn't really an issue.

Michael Bernstein.

___
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] dtml-in batching badly

2001-06-20 Thread Dyon Balding

Michael Bernstein wrote:
 
 But the algorithm doesn't seem 'smart' enough to roll-up the
 batches by recursing through them in reverse order. Arguably
 though, you should never set your batch size smaller than
 the orphan size, so this isn't really an issue.
 

so maybe the dtml batching code should just set the orphans to
the batch size if it is greater than the batch size?  that would
at least eliminate some of the confusion with batching.

-d

-- 
| Dyon Balding . Software Engineer . HiringTools.Monster.com
|   [EMAIL PROTECTED] . +1 415 288 3375

___
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] dtml-in batching badly

2001-06-19 Thread seb bacon

* Joachim Werner [EMAIL PROTECTED] [010618 20:28]:
  That's not the behaviour I'd expect.  Can anyone confirm this is a
  bug?
 
 As LEE Kwan Soo has already said, it is not a bug, but a clever (too
 clever?) feature that should maybe not be enabled by default. Every second
 week or so somebody runs into this and thinks it is a bug.

Thanks for the hint, folks.

I'm not a zope newbie, and this still bit me.  IMO there's something
fairly wrong with the current setup.  either the default behaviour
should be changed to orphans=0, or the visibility of default values
for tags should be improved (from the book: orphan=int The desired
minimum batch size - no mention of defaults).

Furthermore, the 'feature' doesn't work as I'd expect.  In the example
I posted, for the sequence (1,2,3,4), I got: 

 batch 1: 1
 batch 2: 2 3 4
 batch 3: 3 4
 batch 4: 4

This isn't in batches of at least 3... If it were iterating in minimum
batches of 3, shouldn't that be: 

 batch 1: 1 2 3
 batch 2: 2 3 4
 batch 3: 2 3 4
 batch 4: 2 3 4

It's ugly!

seb


___
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] dtml-in batching improved

2001-06-19 Thread Jean Lagarde

Ivo, somehow I had missed the very start of the thread. I think that my
change pretty much implements the third alternative you describe in your
post, but for which you provided no patch (the one which defines the
variables at the top and bottom only, because I leave the if
index==first or index==last test). You are right that my change could
break existing code, but I think not as badly as defining the variables for
every
iteration.

In any case, I will keep the change in my version until I notice a side
effect that I don't like.

Cheers,

Jean

 -Original Message-
 From: Ivo van der Wijk
 Sent: Monday, June 18, 2001 7:31 AM

 This is basically my patch #1. It makes previous-sequence-* and
 next-sequence-* available throughout the entire dtml-in loop.

 This sounds like a good fix, but people may rely on these variables
 being only set at resp. the start and end of the iteration.

 So this patch may break existing dtml code.

 That's why I suggested patch #2, which introduces new variables. Old
 code will continue to work, but people who want the problem fixed can
 use the newly introduced variables, which are available throughout the
 iteration.

   Ivo


___
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] dtml-in batching improved

2001-06-18 Thread Ivo van der Wijk

On Wed, Jun 13, 2001 at 04:28:12PM -0700, Jean Lagarde wrote:
 Good day all,
 
 
 Here is the original code, with my annotated change (I deleted an if test in
 two places):
 
  for index in range(first,end):
 # preset
 kw['previous-sequence']= 0
 kw['next-sequence']= 0 # now more often defined then
 previously
 #
 if index==first or index==last:
 # provide batching information
 if first  0:
 pstart,pend,psize=opt(0,first+overlap,
   sz,orphan,sequence)
  deleted this test --  if index==first: kw['previous-sequence']=1
 kw['previous-sequence-start-index']=pstart-1
 kw['previous-sequence-end-index']=pend-1
 kw['previous-sequence-size']=pend+1-pstart

(more similar code removed)

This is basically my patch #1. It makes previous-sequence-* and
next-sequence-* available throughout the entire dtml-in loop.

This sounds like a good fix, but people may rely on these variables
being only set at resp. the start and end of the iteration.

So this patch may break existing dtml code.

That's why I suggested patch #2, which introduces new variables. Old 
code will continue to work, but people who want the problem fixed can
use the newly introduced variables, which are available throughout the 
iteration.

Ivo

-- 
Drs. I.R. van der Wijk  -=-
Brouwersgracht 132  Amaze Internet Services V.O.F.
1013 HA Amsterdam   -=-
Tel: +31-20-4688336  Linux/Web/Zope/SQL
Fax: +31-20-4688337   Network Solutions
Web: http://www.amaze.nl/Consultancy
Email:   [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] dtml-in batching badly

2001-06-18 Thread seb bacon

Hi,

First, I don't post to this list normally; is it the best place to
discuss an apparent bug?  

Anyway, the lowdown:

If you iterate over a list with a batch size of 1, it messes up
towards the end of the sequence.  For example, the following code:

 dtml-call REQUEST.set('hoo',(1,2,3,4))
   dtml-in hoo 
 calling lt;dtml-in hoo size=1 start=dtml-var sequence-itemgt;:br
 dtml-in hoo size=1 start=sequence-item 
   dtml-var sequence-item
 /dtml-in hr
 /dtml-in

produces the following output:

 calling dtml-in hoo size=1 start=1:
 1 

 calling dtml-in hoo size=1 start=2:
 2 3 4 

 calling dtml-in hoo size=1 start=3:
 3 4 

 calling dtml-in hoo size=1 start=4:
 4

That's not the behaviour I'd expect.  Can anyone confirm this is a
bug? 

Cheers,

seb 

___
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] dtml-in batching badly

2001-06-18 Thread LEE, Kwan Soo

No it's not a bug(in code) but a feature.
May You call it a bug (in usability), though.

What causes it is that the orphan value defaults to 3 when not explicitely set.

See the online help for in tag.

LEE Kwan Soo
¢—ƒzùšŠYb²Öh¥àÞ¿:)zŠà†Ûiÿùb²Û3¢—¨®æj)fjåŠËbú?Ί^uëÍ¡Êè²Êh²Û(¬tÌ-éܡا¥jם–+-²m§ÿåŠËlΊ^¢¸?™¨¥™©ÿ–+-Šwèÿ:)y©ç¢éÜzm§ÿåŠËlΊ^¢¸?™¨¥™©ÿ–+-Šwèÿ:)


Re: [Zope-dev] dtml-in batching badly

2001-06-18 Thread Joachim Werner

 That's not the behaviour I'd expect.  Can anyone confirm this is a
 bug?

As LEE Kwan Soo has already said, it is not a bug, but a clever (too
clever?) feature that should maybe not be enabled by default. Every second
week or so somebody runs into this and thinks it is a bug.

To the DC people: Do you think it would break any code badly if the default
behaviour was orphans=0?


___
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] dtml-in batching badly

2001-06-18 Thread Casey Duncan

Joachim Werner wrote:
 
  That's not the behaviour I'd expect.  Can anyone confirm this is a
  bug?
 
 As LEE Kwan Soo has already said, it is not a bug, but a clever (too
 clever?) feature that should maybe not be enabled by default. Every second
 week or so somebody runs into this and thinks it is a bug.
 
 To the DC people: Do you think it would break any code badly if the default
 behaviour was orphans=0?

Here is a (again perhaps too clever?) suggestion. Make the orphan value
equal zero by default
if size = 3. Otherwise keep it at three.

I'm not oppossed to making it zero all the time either.

-- 
| 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 )



RE: [Zope-dev] dtml-in batching improved

2001-06-05 Thread Adrian Hungate
Title: RE: [Zope-dev] dtml-in batching improved





Back before the zope.org product directory became so easy to navigate I wrote an index
that I used to use which has batch links top and bottom:


http://www.zope.org/Members/haqa/productlist/view_source


Dunno if this helps...


Adrian...


-Original Message-
From: Chris Withers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 30 May 2001 22:03
To: Ivo van der Wijk; [EMAIL PROTECTED]; [EMAIL PROTECTED]; Simon Coles
Subject: Re: [Zope-dev] dtml-in batching improved



 When using batching in dtml-in, why is 'previous-sequence' only defined at
 the first iteration of the current batch? And why is 'next-sequence' only
 defined at the last iteration of the current batch?


I know this problem ;-)


I had it too, and stuck something in the collector about it. I did manage to
get the layout you're after without modifying Zope though (see the search
page on www.nipltd.com)


If you want the code, maybe someone at NIP could fish it out, if you can
wait until next Thursday, I'll grab it myself :-)


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 )





Re: [Zope-dev] dtml-in batching improved

2001-06-03 Thread Chris Withers

   Nope, my solution used only one dtml-in and maybe a dtml-let, no
REQUEST
   munging :-)
  
  Ok, show me :)

 Hurm... gimme a shout next Thursday when I have access to the code again
;-)

Actually, scratch that, check out the folder_contents.dtml file in
CMFDefault/skins of the CMF.
It does some cunning REQUEST variable setting that eliminates the need for
the fanciness I used...

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 )



Re: [Zope-dev] dtml-in batching improved

2001-06-02 Thread Chris Withers

  Nope, my solution used only one dtml-in and maybe a dtml-let, no REQUEST
  munging :-)
 
 Ok, show me :)

Hurm... gimme a shout next Thursday when I have access to the code again ;-)

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 )



Re: [Zope-dev] dtml-in batching improved

2001-06-01 Thread Ivo van der Wijk

On Thu, May 31, 2001 at 05:36:21PM +0100, Chris Withers wrote:
  I've done it myself as well using (as described in the posting) two
  dtml-in's (the second one purely for displaying the prev/next links).
 
  Is your solution any different? (The only one I can think of is storing
  the info in your REQUEST object and using it later, but that's really
  ugly.)
 
 Nope, my solution used only one dtml-in and maybe a dtml-let, no REQUEST
 munging :-)
 

Ok, show me :)

Ivo

-- 
Drs. I.R. van der Wijk  -=-
Brouwersgracht 132  Amaze Internet Services V.O.F.
1013 HA Amsterdam   -=-
Tel: +31-20-4688336  Linux/Web/Zope/SQL
Fax: +31-20-4688337   Network Solutions
Web: http://www.amaze.nl/Consultancy
Email:   [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 )



Re: [Zope-dev] dtml-in batching improved

2001-05-31 Thread Chris Withers

 When using batching in dtml-in, why is 'previous-sequence' only defined at
 the first iteration of the current batch? And why is 'next-sequence' only
 defined at the last iteration of the current batch?

I know this problem ;-)

I had it too, and stuck something in the collector about it. I did manage to
get the layout you're after without modifying Zope though (see the search
page on www.nipltd.com)

If you want the code, maybe someone at NIP could fish it out, if you can
wait until next Thursday, I'll grab it myself :-)

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 )



Re: [Zope-dev] dtml-in batching improved

2001-05-31 Thread Ivo van der Wijk

On Wed, May 30, 2001 at 10:02:31PM +0100, Chris Withers wrote:
  When using batching in dtml-in, why is 'previous-sequence' only defined at
  the first iteration of the current batch? And why is 'next-sequence' only
  defined at the last iteration of the current batch?
 
 I know this problem ;-)
 
 I had it too, and stuck something in the collector about it. I did manage to
 get the layout you're after without modifying Zope though (see the search
 page on www.nipltd.com)
 

I've done it myself as well using (as described in the posting) two
dtml-in's (the second one purely for displaying the prev/next links).

Is your solution any different? (The only one I can think of is storing
the info in your REQUEST object and using it later, but that's really
ugly.)

Ivo

-- 
Drs. I.R. van der Wijk  -=-
Brouwersgracht 132  Amaze Internet Services V.O.F.
1013 HA Amsterdam   -=-
Tel: +31-20-4688336  Linux/Web/Zope/SQL
Fax: +31-20-4688337   Network Solutions
Web: http://www.amaze.nl/Consultancy
Email:   [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 )



Re: [Zope-dev] dtml-in batching improved

2001-05-31 Thread Casey Duncan

Ivo van der Wijk wrote:
 
 On Wed, May 30, 2001 at 10:02:31PM +0100, Chris Withers wrote:
   When using batching in dtml-in, why is 'previous-sequence' only defined at
   the first iteration of the current batch? And why is 'next-sequence' only
   defined at the last iteration of the current batch?
 
  I know this problem ;-)
 
  I had it too, and stuck something in the collector about it. I did manage to
  get the layout you're after without modifying Zope though (see the search
  page on www.nipltd.com)
 
 
 I've done it myself as well using (as described in the posting) two
 dtml-in's (the second one purely for displaying the prev/next links).
 
 Is your solution any different? (The only one I can think of is storing
 the info in your REQUEST object and using it later, but that's really
 ugly.)
 

AFAIK that is what the next and previous options for dtml-in are for.
Usually
I just store the sequence (if it is a query) in a variable using a let
around
three (or more) dtml-ins. Two of which use the next or previous option
to create
the batching links.

-- 
| 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 )



Re: [Zope-dev] dtml-in batching improved

2001-05-31 Thread Chris Withers

 I've done it myself as well using (as described in the posting) two
 dtml-in's (the second one purely for displaying the prev/next links).

 Is your solution any different? (The only one I can think of is storing
 the info in your REQUEST object and using it later, but that's really
 ugly.)

Nope, my solution used only one dtml-in and maybe a dtml-let, no REQUEST
munging :-)

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] dtml-in batching improved

2001-05-29 Thread Ivo van der Wijk

Hi all,

When using batching in dtml-in, why is 'previous-sequence' only defined at
the first iteration of the current batch? And why is 'next-sequence' only 
defined at the last iteration of the current batch?

This behaviour makes it difficult to display a batch like this:

-- begin sample --
Item N
Item N+1
Item N+2

(link to previous items)  (link to next items)
-- end sample --

Because the code would be something like:

-- begin sample --
dtml-in something start=query_start size=3

  [do something with sequence-item]

  dtml-if sequence-end !-- check if last item of batch --
dtml-if previous-sequence
  (link to previous items)
/dtml-if
dtml-if next-sequence
  (link to next items)
/dtml-if
  /dtml-if
/dtml-in
-- end sample --

However, if your batchsize is larger than 1, 'previous-sequence' will always
be untrue at the last item (when sequence-item is true).

The only solution would be implement a second dtml-in after the first one
purely for displaying the previous link.

Also, dtml-in would re-execute your expr (which it does not very efficiently),
so if you want to avoid doing the expr twice, you'd have to store it 
temporarily using dtml-let (or my dtml-set tag ;).

The end result would be:

-- start sample --

dtml-let foo=expr
 dtml-in foo start=start_query size=3
   [do something with sequence-item]
 /dtml-in
 dtml-in foo start=start_query size=3
  !-- code below is safe, as the variables are only true at the resp. top and 
   end, though the truly paranoid could check for sequence-start / -end  

   patch #1 below would break such code!
  --
  dtml-if sequence-end
dtml-if previous-sequence
  (link to previous items)
/dtml-if
dtml-if next-sequence
  (link to next items)
/dtml-if
  /dtml-if
 /dtml-in
/dtml-let

-- end sample --

And at this point I really would start to implement the batching myself in
python :)
 
Of course, basically the same applies if you want both the previous/next link
at the top of the batch display.

(Imagine you want both! :)

Either I'm missing something really obvious here, or the patches below make
sense. There are two versions:

- patch #1: This version fixes the issue above by enabling the values of 
previous/next-sequence throughout the entire batch (and other
related variables as well: X-sequence, X-sequence-start-index, 
X-sequence-end-index, X-sequence-size) (which may break existing sites), and

- patch #2: This version introduces new variablenames, leaving the behaviour of
previous/next-sequence.

A third alternative would be to only define the variables at the top and
bottom of the batch.

Both versions fix (I think) a grammatical error.

It's up to the DC guys if they feel like incorporating either of these patches
in a next release :)

patch #1: define variables everywhere in the batch

This patch makes sure that the following variables are available through
each iteration of dtml-in, for each item.

! This patch may break alot of dtml code !!

next-sequence
next-sequence-start-index
next-sequence-end-index
next-sequence-size
previous-sequence
previous-sequence-start-index
previous-sequence-end-index
previous-sequence-size

-- patch begins here --

*** Zope-2.3.2-orig/lib/python/DocumentTemplate/DT_In.pyFri Apr 13 21:30:38 
2001
--- Zope-2.3.2-src/lib/python/DocumentTemplate/DT_In.py Tue May 29 19:52:36 
2001***
*** 583,611 
  for index in range(first,end):
  # preset
  kw['previous-sequence']= 0
! kw['next-sequence']= 0 # now more often defined then previously
  #
! if index==first or index==last:
! # provide batching information
! if first  0:
! pstart,pend,psize=opt(0,first+overlap,
!   sz,orphan,sequence)
! if index==first: kw['previous-sequence']=1
! kw['previous-sequence-start-index']=pstart-1
! kw['previous-sequence-end-index']=pend-1
! kw['previous-sequence-size']=pend+1-pstart
! try:
! # The following line is a sneaky way to
! # test whether there are more items,
! # without actually computing a length:
! sequence[end]
! pstart,pend,psize=opt(end+1-overlap,0,
!   sz,orphan,sequence)
! if index==last: kw['next-sequence']=1
! kw['next-sequence-start-index']=pstart-1
! kw['next-sequence-end-index']=pend-1
! kw['next-sequence-size']=pend+1-pstart
! except: pass
 

Re: [Zope-dev] dtml-in batching

2001-01-23 Thread Tres Seaver

[EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] wrote:
  
  The dtml-in batching mechanisms are quite difficult to debug - the DTML
  documentation I have has examples which break it and there's no indication
  of why. It turns out the DT_In renderwb() code gobbles all exceptions from
  the rendering of the previous and next blocks. I've hacked my code so that
  there's no try/except clause any more. I'm not sure what exception it's
  trying to catch, but could it perhaps be made a little more picky?
 
 And here's a diff - I'm pretty sure this was the intended behaviour...

Please post this as a "Bug w/ patch" to the Collector:

 http://classic.zope.org:8080/Collector

That way we don't lose your fix in the list traffic (losing it
along with our marbles is another problem :)

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org

___
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] dtml-in batching

2001-01-23 Thread richard

Tres Seaver wrote:
 
 [EMAIL PROTECTED] wrote:
  [EMAIL PROTECTED] wrote:
  
   The dtml-in batching mechanisms are quite difficult to debug - the DTML
   documentation I have has examples which break it and there's no indication
   of why. It turns out the DT_In renderwb() code gobbles all exceptions from
   the rendering of the previous and next blocks. I've hacked my code so that
   there's no try/except clause any more. I'm not sure what exception it's
   trying to catch, but could it perhaps be made a little more picky?
 
  And here's a diff - I'm pretty sure this was the intended behaviour...
 
 Please post this as a "Bug w/ patch" to the Collector:
 
  http://classic.zope.org:8080/Collector
 
 That way we don't lose your fix in the list traffic (losing it
 along with our marbles is another problem :)

   Someone else responded to the list saying that he'd already done it.
There was no match to my search of dtml-in though, so I've submitted a new
bug report.


  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 )




Re: [Zope-dev] dtml-in batching

2001-01-23 Thread Tres Seaver

On Wed, 24 Jan 2001 [EMAIL PROTECTED] wrote:

 Tres Seaver wrote:

  Please post this as a "Bug w/ patch" to the Collector:
  
   http://classic.zope.org:8080/Collector
  
  That way we don't lose your fix in the list traffic (losing it
  along with our marbles is another problem :)
 
 Someone else responded to the list saying that he'd already
 done it.  There was no match to my search of dtml-in though, so
 I've submitted a new bug report.

Thanks very much!

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org


___
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] dtml-in batching

2001-01-23 Thread Brad Clements

On 24 Jan 2001, at 9:43, [EMAIL PROTECTED] wrote:

 Tres Seaver wrote:

  Please post this as a "Bug w/ patch" to the Collector:
  
   http://classic.zope.org:8080/Collector
  
  That way we don't lose your fix in the list traffic (losing it
  along with our marbles is another problem :)
 
Someone else responded to the list saying that he'd already done it.
 There was no match to my search of dtml-in though, so I've submitted a new
 bug report.


I posted this same bug AND a patch as bug # 1566 on Aug 28th, 2000.


http://classic.zope.org:8080/Collector/1566/view

Sad to see its *still* pending



Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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] dtml-in batching

2001-01-23 Thread richard

Brad Clements wrote:
 On 24 Jan 2001, at 9:43, [EMAIL PROTECTED] wrote:
  Tres Seaver wrote:
 
   Please post this as a "Bug w/ patch" to the Collector:
  
http://classic.zope.org:8080/Collector
  
   That way we don't lose your fix in the list traffic (losing it
   along with our marbles is another problem :)
 
 Someone else responded to the list saying that he'd already done it.
  There was no match to my search of dtml-in though, so I've submitted a new
  bug report.
 
 I posted this same bug AND a patch as bug # 1566 on Aug 28th, 2000.
 
 http://classic.zope.org:8080/Collector/1566/view
 
 Sad to see its *still* pending

Well that's odd - I searched the collector for "dtml-in" and got no
matches. A search for "renderwb" (which is in the title) works. Looks like
it doesn't search the description after all. Boo to the search engine.

Just curious: why specify the browser/platform/python version stuff when
the problem is independant of those things?


Richard

ps. Brad, sorry I referred to you as "someone else" - I lost the email with
your name in it ;)

-- 
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 )




Re: [Zope-dev] dtml-in batching

2001-01-23 Thread Brad Clements

On 24 Jan 2001, at 11:15, [EMAIL PROTECTED] wrote:


 Brad Clements wrote:

  I posted this same bug AND a patch as bug # 1566 on Aug 28th, 2000.
  
  http://classic.zope.org:8080/Collector/1566/view
  
  Sad to see its *still* pending
 
 Well that's odd - I searched the collector for "dtml-in" and got no
 matches. A search for "renderwb" (which is in the title) works. Looks like
 it doesn't search the description after all. Boo to the search engine.
 
 Just curious: why specify the browser/platform/python version stuff when
 the problem is independant of those things?
 

Because I'm Anal Retentive.

Also figured perhaps my entry would be ignored without that information.

Or worse the form would be rejected on submit because those fields 
where blank AND it wouldn't remember what I'd put in AND back would 
fail.

So, I filled out the form entirely.


Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
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 batching

2001-01-21 Thread richard

The dtml-in batching mechanisms are quite difficult to debug - the DTML
documentation I have has examples which break it and there's no indication
of why. It turns out the DT_In renderwb() code gobbles all exceptions from
the rendering of the previous and next blocks. I've hacked my code so that
there's no try/except clause any more. I'm not sure what exception it's
trying to catch, but could it perhaps be made a little more picky?


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 )




Re: [Zope-dev] dtml-in batching

2001-01-21 Thread richard

[EMAIL PROTECTED] wrote:
 
 The dtml-in batching mechanisms are quite difficult to debug - the DTML
 documentation I have has examples which break it and there's no indication
 of why. It turns out the DT_In renderwb() code gobbles all exceptions from
 the rendering of the previous and next blocks. I've hacked my code so that
 there's no try/except clause any more. I'm not sure what exception it's
 trying to catch, but could it perhaps be made a little more picky?

   Re-glancing at the code shows me that this is only the case for the next
block. Sorry about that.

-- 
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 )




Re: [Zope-dev] dtml-in batching

2001-01-21 Thread richard

[EMAIL PROTECTED] wrote:
 
 The dtml-in batching mechanisms are quite difficult to debug - the DTML
 documentation I have has examples which break it and there's no indication
 of why. It turns out the DT_In renderwb() code gobbles all exceptions from
 the rendering of the previous and next blocks. I've hacked my code so that
 there's no try/except clause any more. I'm not sure what exception it's
 trying to catch, but could it perhaps be made a little more picky?

And here's a diff - I'm pretty sure this was the intended behaviour...


*** /tmp/DT_In.py.orig  Mon Jan 22 12:00:53 2001
--- DT_In.pyMon Jan 22 12:00:58 2001
***
*** 561,566 
--- 561,570 
  # there are more items, without actually
  # computing a length:
  sequence[end]
+ except IndexError:
+ if self.elses: result=render(self.elses, md)
+ else: result=''
+ else:
  pstart,pend,psize=opt(end+1-overlap,0,
sz,orphan,sequence)
  kw['next-sequence']=1
***
*** 568,576 
  kw['next-sequence-end-index']=pend-1
  kw['next-sequence-size']=pend+1-pstart
  result=render(section,md)
- except:
- if self.elses: result=render(self.elses, md)
- else: result=''
  else:
  result = []
  append=result.append
--- 572,577 


-- 
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 )