Re: [Zope-dev] Bug in Shared/DC/ZRDB/DA.py

2006-11-17 Thread Chris Withers

Dieter Maurer wrote:

from BTrees.IOBTree import IOBucket


would be the new equivalent to the old IOBTree.Bucket.


Thanks, I'm currently working up some unit tests for the caching code 
and I'll switch this in once I've got some failing tests.


It's a shame no-one has replied to my other email...

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

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

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


Re: [Zope-dev] Re: Windows Installer Nice-to-have

2006-11-17 Thread Chris Withers

Sidnei da Silva wrote:

Chris,

Do you feel like blessing the current installer for upload to zope.org?


Sure, I'll whack them up there some time soon :-)

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

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

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


[Zope-dev] Re: [Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ fix #2235 for real now

2006-11-17 Thread Chris Withers

Leonardo Rochael Almeida wrote:

-obj = self.aq_parent.unrestrictedTraverse(self.getpath(rid))
-if not obj:
+obj = self.aq_parent.unrestrictedTraverse(self.getpath(rid), None)
+if obj is None:
Please revert this change. You've changed the semantics of this 
statement and it will now mask errors in traversing to the path.


This is bad...


I agree with you the semantics have changed, but I argue that they've
changed to what they were intended to be in the first place :-)


This argument has been had many times before, please google zope-dev's 
archives for the numerous discussions on this and then check the current 
implementation in 
Products/ZCatalog/CatalogBrains.py:AbstractCatalogBrains.getOject.



This is the full method before my changes:

def getobject(self, rid, REQUEST=None):
Return a cataloged object given a 'data_record_id_'

obj = self.aq_parent.unrestrictedTraverse(self.getpath(rid))
if not obj:
if REQUEST is None:
REQUEST=self.REQUEST
obj = self.resolve_url(self.getpath(rid), REQUEST)
return obj


This code is just plain rubbish, there's no single bug here.

I'd like someone to give a use case where unrestrictedTraverse fails and 
yet where resolve_url works.



Traversing with a default argument will only mask traversal errors, not
any other errors that might happen during traversing.


Sure it will, see previous discussions...


In the version with my changes, but with the old unrestrictedTraverse
call, the if obj is None would only ever be reached in the
pathological situation where the attribute at the end of the path is
None. Which means the .resolve_url(self.getpath(rid), REQUEST) would
hardly ever be called at all.


Correct. .resolve_url(self.getpath(rid), REQUEST) hardly ever gets called.


A) Keep my changes, but use a marker object() instead of None for the
default parameter of the .unrestrictedTraverse() call.

B) Reverse my changes, but also remove the if not obj block, which is
buggy whichever way you look at it with the old unrestrictedTraverse
call.

Which one should it be?


I'd go for B.

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

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

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


Re: [Zope-dev] Cache code in Shared/DC/ZRDB/DA.py

2006-11-17 Thread Chris Withers

Tino Wildenhain wrote:

I have a replacement started, which uses Cacheable mixin instead.
Advantage is, with RAM Cache Manager you can see the hits your method
cause and invalide the cache per object. I also introduced a execution
time treshold, so you can configure to only cache runtimes say above
1 sec, leaving more room for long running queries.

I think I should packe up what I have now (rough edges) so you
can have a look at it.


I have to be honest, I'm looking to simplify, and this sounds a LOT more 
complicated...


Chris

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

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


Re: [Zope-dev] Cache code in Shared/DC/ZRDB/DA.py

2006-11-17 Thread Tino Wildenhain

Chris Withers schrieb:

Tino Wildenhain wrote:

I have a replacement started, which uses Cacheable mixin instead.
Advantage is, with RAM Cache Manager you can see the hits your method
cause and invalide the cache per object. I also introduced a execution
time treshold, so you can configure to only cache runtimes say above
1 sec, leaving more room for long running queries.

I think I should packe up what I have now (rough edges) so you
can have a look at it.


I have to be honest, I'm looking to simplify, and this sounds a LOT more 
complicated...


No actually it isnt. I ripped out a lot of the old code. All other stuff
is easily handled by the cache code anyway.

ZSQL Methods and all that stuff is horribly old and full of calamities.
Apart from the cache management nightmare, there is also a lot of
ZMI stuff really wrong. You dont see the right encoding because
the test pages ignore it, you have a pretty formatter for
column names - hiding their real name and you always have to wonder
the name of the variable you get in the result set.

(fOO_bar becomes FOO bar for example)

and so on :-)

I think I just upload what I have so you can have
a look at it :-)

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

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


[Zope-dev] Zope Tests: 8 OK, 1 Failed

2006-11-17 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Thu Nov 16 12:00:00 2006 UTC to Fri Nov 17 12:00:00 2006 UTC.
There were 9 messages: 9 from Zope Unit Tests.


Test failures
-

Subject: FAILED (failures=2) : Zope-2.8 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Thu Nov 16 21:35:48 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006589.html


Tests passed OK
---

Subject: OK : Zope-2.6 Python-2.1.3 : Linux
From: Zope Unit Tests
Date: Thu Nov 16 21:28:18 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006584.html

Subject: OK : Zope-2.6 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Thu Nov 16 21:29:48 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006585.html

Subject: OK : Zope-2.7 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Thu Nov 16 21:31:18 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006586.html

Subject: OK : Zope-2.7 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Thu Nov 16 21:32:48 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006587.html

Subject: OK : Zope-2.8 Python-2.3.6 : Linux
From: Zope Unit Tests
Date: Thu Nov 16 21:34:18 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006588.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Thu Nov 16 21:37:19 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006590.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Thu Nov 16 21:38:49 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006591.html

Subject: OK : Zope-trunk Python-2.4.4 : Linux
From: Zope Unit Tests
Date: Thu Nov 16 21:40:19 EST 2006
URL: http://mail.zope.org/pipermail/zope-tests/2006-November/006592.html

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


Re: [Zope-dev] Cache code in Shared/DC/ZRDB/DA.py

2006-11-17 Thread Tino Wildenhain

Chris Withers schrieb:

Tino Wildenhain wrote:

I have a replacement started, which uses Cacheable mixin instead.
Advantage is, with RAM Cache Manager you can see the hits your method
cause and invalide the cache per object. I also introduced a execution
time treshold, so you can configure to only cache runtimes say above
1 sec, leaving more room for long running queries.

I think I should packe up what I have now (rough edges) so you
can have a look at it.


I have to be honest, I'm looking to simplify, and this sounds a LOT more 
complicated...


And here it is (maybe it takes a couple of minutes to be visible)

http://www.zope.org/Members/tino/CachedZSQLMethods

http://www.zope.org/Members/tino/CachedZSQLMethods/CachedZSQLMethodsPrerelease/CachedZSQLMethods_0.1_alpha.tgz

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

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


Re: [Zope-dev] Re: [Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ fix #2235 for real now

2006-11-17 Thread Leonardo Rochael Almeida
Em Sex, 2006-11-17 às 07:48 +, Chris Withers escreveu:
 Leonardo Rochael Almeida wrote:
 []
 
  This is the full method before my changes:
  
  def getobject(self, rid, REQUEST=None):
  Return a cataloged object given a 'data_record_id_'
  
  obj = self.aq_parent.unrestrictedTraverse(self.getpath(rid))
  if not obj:
  if REQUEST is None:
  REQUEST=self.REQUEST
  obj = self.resolve_url(self.getpath(rid), REQUEST)
  return obj
 
 [...]
 
  A) Keep my changes, but use a marker object() instead of None for the
  default parameter of the .unrestrictedTraverse() call.
  
  B) Reverse my changes, but also remove the if not obj block, which is
  buggy whichever way you look at it with the old unrestrictedTraverse
  call.
  
  Which one should it be?
 
 I'd go for B.

If no one else chimes in today, I'll implement B.
ZCatalog .getobject(rid) call will simply call unrestrictedTraverse,
ignoring the REQUEST. parameter. I'll add a deprecation warning on the
trunk if the REQUEST parameter is passed in.

Cheers, Leo

-- 
Leonardo Rochael Almeida
Enfold Systems
http://www.enfoldsystems.com
phone. +1.713.942.2377 Ext 215
fax. +1.832.201.8856

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


[Zope-dev] Upcoming releases: 2.10.1, 2.9.6

2006-11-17 Thread Andreas Jung

I am planning  to release 2.10.1 and 2.9.6 early next week (likely on TUE).

Cheers,
Andrfeas

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


Re: [Zope-dev] Upcoming releases: 2.10.1, 2.9.6

2006-11-17 Thread Chris Withers

Andreas Jung wrote:

I am planning  to release 2.10.1 and 2.9.6 early next week (likely on TUE).


I'll hopefully be checking in today, but please can you wait until I've 
checked in a fix for #2212?


cheers,

Chris

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

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


Re: [Zope-dev] Upcoming releases: 2.10.1, 2.9.6

2006-11-17 Thread Andreas Jung



--On 17. November 2006 16:05:02 + Chris Withers 
[EMAIL PROTECTED] wrote:



Andreas Jung wrote:

I am planning  to release 2.10.1 and 2.9.6 early next week (likely on
TUE).


I'll hopefully be checking in today, but please can you wait until I've
checked in a fix for #2212?




Go, go, go :-)

-aj

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


[Zope-dev] Re: Upcoming releases: 2.10.1, 2.9.6

2006-11-17 Thread Dorneles Treméa
Hey folks,

 I am planning  to release 2.10.1 and 2.9.6 early next week (likely on TUE).

anyone with 5 minutes available to bless my fix for #2191? :-)

http://www.zope.org/Collectors/Zope/2191

-- 
 ___

   Dorneles Treméa · Developer · Plone Solutions · Brazil

   Consulting · Training · Development · http://plonesolutions.com
 ___

  Plone Foundation · http://plone.org/foundation · Protecting Plone

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


Re: [Zope-dev] Upcoming releases: 2.10.1, 2.9.6

2006-11-17 Thread Chris Withers

Andreas Jung wrote:



I'll hopefully be checking in today, but please can you wait until I've
checked in a fix for #2212?


Go, go, go :-)


Your wish is my command :-P

cheers,

Chris

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

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


Re: [Zope-dev] Cache code in Shared/DC/ZRDB/DA.py

2006-11-17 Thread Chris Withers

Chris Withers wrote:


I have to be honest, I'm looking to simplify, and this sounds a LOT more 
complicated...


Okay, I've written unit tests and refactored the code on the 2.9 branch, 
2.10 branch and trunk.


Please let me know if you have any problems...

cheers,

Chris

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

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


Re: [Zope-dev] Cache code in Shared/DC/ZRDB/DA.py

2006-11-17 Thread Dieter Maurer
Chris Withers wrote at 2006-11-16 17:29 +:

I'm wondering if you can still remember the rational behind the cache 
code at around lines 355-387 of:

http://svn.zope.org/Zope/trunk/lib/python/Shared/DC/ZRDB/DA.py?rev=68158view=auto

This code is pretty old (checked in 5th Dec 1997) but has started 
causing a few people problems under high load:

http://mail.zope.org/pipermail/zope-db/2006-September/004684.html
http://www.zope.org/Collectors/Zope/2212

In particular:

- in line 368, why is len(cache)max_cache/2 used as a trigger to start 
cache clearing? (the /2 in particular)

You may want to start getting rid of keys old enough that you would not
use them anyway already before you reached max cache.

I do not know why that is not done always -- an
XYBucket has an efficient method to determine the minimal key,
thus we could get rid of the len(cache)  max_cache /2.

And of course, it is quite stupid to determine the keys and reverse
them, even when no key is old enough

- does it matter that IOBTree.Bucket has gone away and that tcache is
   now a simple dictionary? It certainly seems to make the keys.reverse()
   on line 370 superfluous and the keys[-1]t on line 371 less reliable.

Yes. You want to kill the dict and use the IOBucket...

More generally, do you or does anyone else have any attachment to this 
code or would anyone mind if I ripped it out and replaced it with 
something simpler, with more comments and unit tests?

Very good idea.


If you are at it.

The idea to have this cache maintained via a _v_ attribute
is insane. A module level cache would be much more efficient
and save memory as well.


You may look at my CCZSQLMethods...



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


Re: [Zope-dev] Cache code in Shared/DC/ZRDB/DA.py

2006-11-17 Thread Tino Wildenhain

Chris Withers schrieb:

Chris Withers wrote:


I have to be honest, I'm looking to simplify, and this sounds a LOT 
more complicated...


Okay, I've written unit tests and refactored the code on the 2.9 branch, 
2.10 branch and trunk.


Please let me know if you have any problems...


Uh oh - which code? :-)

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

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


Re: [Zope-dev] Re: Upcoming releases: 2.10.1, 2.9.6

2006-11-17 Thread Leonardo Rochael Almeida
Em Sex, 2006-11-17 às 14:20 -0200, Dorneles Treméa escreveu:
 Hey folks,
 
  I am planning  to release 2.10.1 and 2.9.6 early next week (likely on TUE).
 
 anyone with 5 minutes available to bless my fix for #2191? :-)
 
 http://www.zope.org/Collectors/Zope/2191

Looks good enough for me.
-- 
Leonardo Rochael Almeida
Enfold Systems
http://www.enfoldsystems.com
phone. +1.713.942.2377 Ext 215
fax. +1.832.201.8856

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


Re: [Zope-dev] Zope Foundation membership drive

2006-11-17 Thread Jim Fulton

Lennart Regebro wrote:

And funnily enough, I'm not in there, although Florent is, and our
papers should have been faxed in at the same time.


You were in the list of members on the old site.

Sathya,

How is the membership list on the new site created?

Is there something I can update somewhere?

Jim

--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

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