[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/Products/Five/api.py removed pre-Five-1.0 cruft (this file does not belong to Five 1.0)

2005-05-27 Thread Yvo Schubbe
Log message for revision 30528: removed pre-Five-1.0 cruft (this file does not belong to Five 1.0) Changed: D Zope/branches/Zope-2_8-branch/lib/python/Products/Five/api.py -=- Deleted: Zope/branches/Zope-2_8-branch/lib/python/Products/Five/api.py

[Zope-Checkins] CVS: Zope/doc - CHANGES.txt:1.625.2.334

2005-05-27 Thread Tres Seaver
Update of /cvs-repository/Zope/doc In directory cvs.zope.org:/tmp/cvs-serv13610/doc Modified Files: Tag: Zope-2_7-branch CHANGES.txt Log Message: - Collector #889: made 'and' operator for KeywordIndexes actually restrict results as expected (thanks to 'aroda' for the

[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ Made 'and' operator for KeywordIndexes actually restrict results as expected.

2005-05-27 Thread Tres Seaver
Log message for revision 30532: Made 'and' operator for KeywordIndexes actually restrict results as expected. Collector #889 -- thanks to 'aroda' for the patch! Changed: U Zope/branches/Zope-2_8-branch/doc/CHANGES.txt U

[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PluginIndexes/ Forward port fix for Collector #889 from 2.8 branch.

2005-05-27 Thread Tres Seaver
Log message for revision 30533: Forward port fix for Collector #889 from 2.8 branch. Changed: U Zope/trunk/lib/python/Products/PluginIndexes/KeywordIndex/tests/testKeywordIndex.py U Zope/trunk/lib/python/Products/PluginIndexes/common/UnIndex.py -=- Modified:

[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/ Use a properly constructed tag for the Zope3 code.

2005-05-27 Thread Tim Peters
Log message for revision 30543: Use a properly constructed tag for the Zope3 code. Changed: _U Zope/branches/Zope-2_8-branch/lib/python/ -=- Property changes on: Zope/branches/Zope-2_8-branch/lib/python ___ Name:

[Zope-dev] hasattr implementation for Zope?

2005-05-27 Thread Chris Withers
Dieter Maurer wrote: I strongly argue against it. Fix hasattr in the Zope context, instead! _marker = [] def hasattr(obj, attr, marker): a = getattr(obj, attr, _marker) return a is not _marker import __builtin__ __builtin__.hasattr = hasattr Easy

Re: [Zope-dev] hasattr implementation for Zope?

2005-05-27 Thread Paul Winkler
On Fri, May 27, 2005 at 08:53:54AM +0100, Chris Withers wrote: Anyone think putting this in Zope core is a good idea? If so, where should it go? Any potential performance implications people can think of? fwiw, tonight I ran some quick request-per-second tests (using ab -n 100 -c 10) on a

Re: [Zope-dev] RAMcache and container vs. context

2005-05-27 Thread Stefan H. Holek
A TALES expression may be prohibitively expensive in any case, no matter how simple it is kept. Please make sure to do some comparative profiling. Cache keys are recomputed on every call of the script, AFAICS. The thought of doing this in restricted Python makes my skin crawl. Stefan

[Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chris Withers wrote: Dieter Maurer wrote: I strongly argue against it. Fix hasattr in the Zope context, instead! _marker = [] def hasattr(obj, attr, marker): a = getattr(obj, attr, _marker) return a is not _marker

[Zope-dev] Re: [Interested?] New use for Zope+CMF+Archetypes -- startup time improvements

2005-05-27 Thread Dieter Maurer
Dieter Maurer wrote at 2005-5-13 19:26 +0200: ... high Zope startup time ... To overcome this obstacle, we tweaked Zope and fixed Python's import mechanism such that Zope now starts either out of a ZIP archive or as a frozen application. ... In more details, we did: * implement a package for

Re: [Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Tim Peters
[Tres Seaver] [...] - -1. Python's 'hasattr' semantics are *broken by definition*, and will never be fixed (because of backward compatibility). Non-Zope Python programmers will *not* expect or want exceptions raised from 'hasattr'. As a local patch, this isn't too bad (one could even

Re: [Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Jim Fulton
Tim Peters wrote: [Tres Seaver] [...] - -1. Python's 'hasattr' semantics are *broken by definition*, and will never be fixed (because of backward compatibility). Non-Zope Python programmers will *not* expect or want exceptions raised from 'hasattr'. As a local patch, this isn't too bad (one

Re: [Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Paul Winkler
On Fri, May 27, 2005 at 09:25:58AM -0400, Jim Fulton wrote: Tim Peters wrote: OTOH, defining importing a utility function-- say, safehasattr() --would make it all explicit. That's what ZODB does. OK. (BTW, I just went grepping for this safehasattr() in zope 2.7.6's ZODB and didn't find

Re: [Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Jim Fulton
Paul Winkler wrote: On Fri, May 27, 2005 at 09:25:58AM -0400, Jim Fulton wrote: Tim Peters wrote: OTOH, defining importing a utility function-- say, safehasattr() --would make it all explicit. That's what ZODB does. OK. (BTW, I just went grepping for this safehasattr() in zope

Re: [Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Tim Peters
[Tim Peters] OTOH, defining importing a utility function-- say, safehasattr() --would make it all explicit. That's what ZODB does. [Paul Winkler] OK. (BTW, I just went grepping for this safehasattr() in zope 2.7.6's ZODB and didn't find anything. What's it called?) No such thing in ZODB

Re: [Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Paul Winkler
On Fri, May 27, 2005 at 11:52:10AM -0400, Tim Peters wrote: Spend an hour analyzing each one 0.9 wink. Let's compromise. I'll spend 0.9 hours analyzing one of them. ;-) -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist -

Re: [Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Paul Winkler
On Fri, May 27, 2005 at 11:49:03AM -0400, Jim Fulton wrote: BTW, I prefer to code things like this in the following way: def safe_hasattr(): marker = object() def safe_hasattr(obj, attr): return getattr(obj, attr, marker) is not marker return safe_hasattr

Re: [Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Paul Winkler
On Fri, May 27, 2005 at 12:08:55PM -0400, Paul Winkler wrote: On Fri, May 27, 2005 at 11:49:03AM -0400, Jim Fulton wrote: BTW, I prefer to code things like this in the following way: def safe_hasattr(): marker = object() def safe_hasattr(obj, attr): return

Re: [Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Jim Fulton
Paul Winkler wrote: On Fri, May 27, 2005 at 12:08:55PM -0400, Paul Winkler wrote: On Fri, May 27, 2005 at 11:49:03AM -0400, Jim Fulton wrote: BTW, I prefer to code things like this in the following way: def safe_hasattr(): marker = object() def safe_hasattr(obj, attr):

Re: [Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Paul Winkler
On Fri, May 27, 2005 at 01:10:29PM -0400, Jim Fulton wrote: Paul Winkler wrote: On Fri, May 27, 2005 at 12:08:55PM -0400, Paul Winkler wrote: On Fri, May 27, 2005 at 11:49:03AM -0400, Jim Fulton wrote: BTW, I prefer to code things like this in the following way: def safe_hasattr():

Re: [Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Tim Peters
[Paul Winkler] But of course we don't do it because accessing globals in a method that might be looped over is slow. Which, hopefully, will become a non-issue some day (PEP 267, 268, 280). [Jim Fulton] Note that in my version above, marker is a local rather than a global and gets looked up

Re: [Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Jim Fulton
This is amazing. Really amazing. I stand corrected. Jim Tim Peters wrote: [Paul Winkler] But of course we don't do it because accessing globals in a method that might be looped over is slow. Which, hopefully, will become a non-issue some day (PEP 267, 268, 280). [Jim Fulton] Note

Re: [Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Tim Peters
[Jim Fulton, on cell dereferencing's (lack of) speed] This is amazing. Really amazing. I stand corrected. Well, there's no mystery if you look at LOAD_FAST and LOAD_DEREF in ceval.c; LOAD_DEREF is slower wink. The relative speed of approaches changes across Python releases too. For example,

Re: [Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Sidnei da Silva
On Fri, May 27, 2005 at 01:49:00PM -0400, Tim Peters wrote: | Under WinXP Python 2.4.1, the global trick (lookup3) is consistently | fastest, and the lexical scope trick (lookup2) is consistently | slowest; this is typical output across 3 runs: Humm... May not be a surprise for you, but in one

Re: [Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Paul Winkler
On Fri, May 27, 2005 at 01:49:00PM -0400, Tim Peters wrote: Nope, it's a cell reference to an enclosing scope, and gets looked up at cell-dereference speed. In my experience, that's generally a bit slower than accessing a module global. That may have to do with a quirk of MSVC's code

[Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tim Peters wrote: Vewy strange -- it looks as though OS-level caching matters here: $ python Python 2.4.1 (#2, Mar 30 2005, 21:51:10) [GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2 Type help, copyright, credits or license for more information. $

[Zope-dev] Re: hasattr implementation for Zope?

2005-05-27 Thread Tim Peters
We're getting the usual timing results here: it's a cross-platform, cross-release crapshoot. Aiming at (just) a few percent really is worthless -- modern processors and OSes are too complex to out-think uniformly in the small, and even if Python variability didn't contribute to the differences.

Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Tino Wildenhain
Am Freitag, den 27.05.2005, 00:20 +0200 schrieb Jaroslav Lukesh: ... I absolutelly agree with you, it is like my words. But separation of logic and presentation could be done successfully in DTML too. ZPT, which have separation argument is not as easy to make totally This is even somewhat

Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Greg Fischer
Wow, thanks for the replies guys. It's good to hear I am not the only one who likes DTML. Tino, thanks for the explanations. I have some thoughts below on that, and keep in mind, I am questioning from my own ignorance. Tino Wrote: The major drawbacks of DTML are: - one namespace (with

Re: [Zope] Finding an object in a folder

2005-05-27 Thread Chris Withers
Paul Winkler wrote: marker = () if getattr(some_object, marker) is not marker: For good measure, I wonder if that should be a [], no a ()? cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk

Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Chris Withers
Tino Wildenhain wrote: Unfortunately Plone is still a bad example for ZPT. It is getting better but still it has a lot of code and definition in the templates. Maybe AT would be a way out. AT? As in ArcheTypes? You ARE kidding right? I've never seen such bad code, and in particular, abuse of

Re: [Zope] UnicodeDecodeError

2005-05-27 Thread Chris Withers
Dieter Maurer wrote: Only the default is latin-1 (as specified by the HTML specification). Indeed, but that should be configurable... Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk

Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Hugo Ramos
On 5/27/05, Chris Withers [EMAIL PROTECTED] wrote: AT? As in ArcheTypes? You ARE kidding right? I've never seen such bad code, and in particular, abuse of ZPT in my entire life... And DTML sux, you wanna use it, fine, that says something about you. Use ZClasses, Plone, AT and XUF at the same

Re: [Zope] Finding an object in a folder

2005-05-27 Thread Paul Winkler
On Fri, May 27, 2005 at 08:51:58AM +0100, Chris Withers wrote: Paul Winkler wrote: marker = () if getattr(some_object, marker) is not marker: For good measure, I wonder if that should be a [], no a ()? What's wrong with a tuple? There's no reason to mutate the marker. -- Paul Winkler

[Zope] Saving the html-code

2005-05-27 Thread Flemming Bjerke
With a dtml-script I renders data from a mysql-database. But, sometimes I should like to save the html-code generated by the script. When I try to do this with a pythonscript I run into problems with acquiring the html-code generated by the dtml-script. I looks like the dtml-script does not get

Re: [Zope] LDAPUserFolder at Zope root

2005-05-27 Thread Jens Vagelpohl
On May 26, 2005, at 22:34, J Cameron Cooper wrote: Oscar Figueiredo wrote: this might be trivial but I just can't find a way to do it. How does one replace the initial UserFolder at Zope root with a LDAPUSerFolder ? I tried the dummy way : delete the acl_users with an intent to

Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Lennart Regebro
On 5/26/05, Greg Fischer [EMAIL PROTECTED] wrote: Is DTML really that much harder to use? Nah, but it's uglier. Also, the idea is that a web editor that confirms to the tsandard of ignoring things it doens't understand, should in theory be usable with TAL, but not with DTML. In practice,

[Zope] Zope MailHost Query

2005-05-27 Thread Varun Parange
hi, how do i receive mails using Zope mailhost?? Do You Yahoo!? Yahoo! Small Business - Try our new Resources site!___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related

Re: [Zope] Zope MailHost Query

2005-05-27 Thread Andreas Jung
--On Freitag, 27. Mai 2005 3:15 Uhr -0700 Varun Parange [EMAIL PROTECTED] wrote: hi, how do i receive mails using Zope mailhost?? MailHost is only for *sending* but not for receiving mails. Zope is *not* an SMTP server. -aj pgpSF9JJiUCyr.pgp Description: PGP signature

Re: [Zope] Finding an object in a folder

2005-05-27 Thread Florent Guillaume
Paul Winkler [EMAIL PROTECTED] wrote: On Fri, May 27, 2005 at 08:51:58AM +0100, Chris Withers wrote: Paul Winkler wrote: marker = () if getattr(some_object, marker) is not marker: For good measure, I wonder if that should be a [], no a ()? What's wrong with a tuple? There's no

[Zope] Re: Finding an object in a folder

2005-05-27 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul Winkler wrote: On Fri, May 27, 2005 at 08:51:58AM +0100, Chris Withers wrote: Paul Winkler wrote: marker = () if getattr(some_object, marker) is not marker: For good measure, I wonder if that should be a [], no a ()? What's wrong with

Re: [Zope] Namespace for PythonScript

2005-05-27 Thread Dieter Maurer
Hong Yuan wrote at 2005-5-27 00:07 +0800: If a PythonScript is called from a Page Template, how can it access the variables defined using: tal:define=global ... / in the calling script? It may work to bind the namespace binding. Not sure, though... -- Dieter

Re: [Zope] Saving the html-code

2005-05-27 Thread Dieter Maurer
Flemming Bjerke wrote at 2005-5-27 11:20 +0200: With a dtml-script I renders data from a mysql-database. But, sometimes I should like to save the html-code generated by the script. When I try to do this with a pythonscript I run into problems with acquiring the html-code generated by the

Re: [Zope] Finding an object in a folder

2005-05-27 Thread Dieter Maurer
Paul Winkler wrote at 2005-5-27 05:07 -0400: ... What's wrong with a tuple? There's no reason to mutate the marker. The Python spec allows implementations to identify immutable objects with the same value. Thus, in principle, two () created at different times can in fact be the same object.

Re: [Zope] Finding an object in a folder

2005-05-27 Thread Dieter Maurer
Paul Winkler wrote at 2005-5-26 19:57 -0400: ... Make it so! :-) _marker = [] def hasattr(obj, attr, marker): I introduced a bug here (noticed by Alec Mitchell). The marker argument should have been _marker=_marker. ... Are you currently running zope with a patch like this?

Re: [Zope] Finding an object in a folder

2005-05-27 Thread Paul Winkler
On Fri, May 27, 2005 at 01:58:44PM +0200, Florent Guillaume wrote: And all empty tuples are equal. Not just equal, but all empty tuples are *identical*, so () is () == True. I had no idea this was so :-\ In python 2.3, the idiom most commonly found is to use marker = object(). Thanks for

Re: [Zope] Finding an object in a folder

2005-05-27 Thread Paul Winkler
On Fri, May 27, 2005 at 03:26:04PM +0200, Dieter Maurer wrote: A higher risk comes from the fact that some Python packages may rely on the broken hasattr behaviour. That's the reason why the problem is not fixed in Python itself. And that's a very good reason not to monkeypatch it. We can't

Re: [Zope] Saving the html-code

2005-05-27 Thread Flemming Bjerke
Fredag den 27. maj 2005 15:33 skrev Dieter Maurer: Flemming Bjerke wrote at 2005-5-27 11:20 +0200: With a dtml-script I renders data from a mysql-database. But, sometimes I should like to save the html-code generated by the script. When I try to do this with a pythonscript I run into problems

[Zope] Opening .doc files in zope

2005-05-27 Thread Allen Huang
Is there any way to open a .doc files using dtml or script and print them?? Yahoo! Mail Stay connected, organized, and protected. Take the tour___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML

Re: [Zope] Opening .doc files in zope

2005-05-27 Thread Dennis Allison
On Fri, 27 May 2005, Allen Huang wrote: Is there any way to open a .doc files using dtml or script and print them?? The short answer is it depends. To make such files generally available you have to convert them to HTML so arbirary browsers can access them. You can use MS Word to do the

Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Greg Fischer
Using DTML from WYSIWYG editors is definitely a drawback. But, how many of us use them for doing our work? I might use Dreamweaver to clean up my sliced web template, but soon as I start my Zope work, it's all Crimson Editor coding by hand to Zope. Using Dreamweaver actually slows me down, it's

[Zope] Re: Opening .doc files in zope

2005-05-27 Thread Josef Meile
The short answer is it depends. To make such files generally available you have to convert them to HTML so arbirary browsers can access them. You can use MS Word to do the conversion. If your Zope is running on a Windows machine that also has Word, you can manage the conversion dynamically

Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Greg Fischer
Ah you are right. Just occured to me. That is kind of a pain in DTML, but I've learned how to deal with it. Makes sense. If I already have an object, say from a form submitted, in the REQUEST namespace, and I then retrieve data from sql and a column has the same name, I will have an issue.

Re: [Zope] LDAPUserFolder at Zope root

2005-05-27 Thread J Cameron Cooper
Jens Vagelpohl wrote: On May 26, 2005, at 22:34, J Cameron Cooper wrote: Oscar Figueiredo wrote: this might be trivial but I just can't find a way to do it. How does one replace the initial UserFolder at Zope root with a LDAPUSerFolder ? I tried the dummy way : delete the acl_users

[Zope] Receiving mails

2005-05-27 Thread Varun Parange
hi, i have downloaded an SMTP server and using it i can send mails with the help of Zope MailHost however i would also like to recieve mails how do i do this. which additional products do i need to download... regards, varun __Do You

Re: [Zope] Receiving mails

2005-05-27 Thread J Cameron Cooper
Varun Parange wrote: i have downloaded an SMTP server and using it i can send mails with the help of Zope MailHost however i would also like to recieve mails how do i do this. which additional products do i need to download... I recall some people talking about actually turning

Re: [Zope] Receiving mails

2005-05-27 Thread David H
Varun Parange wrote: hi, i have downloaded an SMTP server and using it i can send mails with the help of Zope MailHost however i would also like to recieve mails how do i do this. which additional products do i need to download... regards, varun Varun, I wrote a spam

Re: [Zope] Finding an object in a folder

2005-05-27 Thread Paul Winkler
On Tue, May 24, 2005 at 08:59:01PM +0200, Dieter Maurer wrote: An incredibly long time ago, I filed a feature request for hasattr_unacquired -- together with patch, unit tests and documentation update. Do you mean this? http://www.zope.org/Collectors/Zope/742 the unit tests and docs are

[Zope] XML Content handling questions.

2005-05-27 Thread Nikko Wolf
Three questions, in order of importance (to me): 1) Is it possible to validate an (uploaded) XML file against a schema (currently on the Zope server)? What, if any, extra packages are needed?I want to use this in my upload forms to alert the user if their files are invalid. 2) I

Re: [Zope] Create a list using DTML.

2005-05-27 Thread Fernando Lujan
On 24/05/05, J Cameron Cooper [EMAIL PROTECTED] wrote: Personally, I'd probably just do something like:: {1,2,3}[1:-1].split(',') This code works as expected... Thanks! :) -- Fernando Lujan ___ Zope maillist - Zope@zope.org

Re: [Zope] DTML in Zope 2 vs Zope 3

2005-05-27 Thread Andrew Milton
+---[ Jonathan Cyr ]-- | Damn users, using all this imperfect software. These Kids Today! ;-) | | Easy Big Fella, Whooa. | You must be new here We've all learnt to ignore Chris... He gets easily confused... or maybe he doesn't take his medication... not sure, but,

Re: [Zope] XML Content handling questions.

2005-05-27 Thread Andreas Jung
Zope itself has no native XML support. However there are some products like ParsedXML that provide additional functionality. You might also look at Silva CMS which is provides native XML support. -aj --On 27. Mai 2005 14:53:40 -0600 Nikko Wolf [EMAIL PROTECTED] wrote: Three questions, in