I have a short python script:
gc = context.restrictedTraverse('coup/temp_folder/GarbageCollector', None)
print 'gc=',str(gc)
if gc:
print 'GarbageCollector exists'
else:
print 'No GarbageCollector'
which, when run produces:
gc= TransientObjectContainer at GarbageCollector
No GarbageCollector
On 5/9/06, Jonathan [EMAIL PROTECTED] wrote:
I think I am misunderstanding something basic about python/zope here. Why
does a TOC object evaluate to false?
Well, why not? If you are checking for none-ness, use is None.
Evaluating the object is wrong.
If the TOC object evaluates to something
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 9 May 2006, at 16:18, Jonathan wrote:
gc= TransientObjectContainer at GarbageCollector
GarbageCollector exists
I think I am misunderstanding something basic about python/zope
here. Why does a TOC object evaluate to false?
I think the basic
--On 9. Mai 2006 11:18:25 -0400 Jonathan [EMAIL PROTECTED] wrote:
I have a short python script:
gc = context.restrictedTraverse('coup/temp_folder/GarbageCollector', None)
print 'gc=',str(gc)
if gc:
print 'GarbageCollector exists'
else:
print 'No GarbageCollector'
which, when run
:25 AM
Subject: Re: [Zope] A quick zope/python question
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 9 May 2006, at 16:18, Jonathan wrote:
gc= TransientObjectContainer at GarbageCollector
GarbageCollector exists
I think I am misunderstanding something basic about python/zope here.
Why
hi all!
i think there should be no functional difference in the two code snippets
below, but is there any difference in performance?
(i know, the except AttributeError could possibly mask an AttributeError
in the called function...)
1.:
hook = getattr(o, '_before_transaction_commit', None)
if
--On 1. Juli 2005 17:10:58 +0200 Jürgen Herrmann
[EMAIL PROTECTED] wrote:
hi all!
i think there should be no functional difference in the two code snippets
below, but is there any difference in performance?
You could benchmark it :-)
-aj
pgphfg7D56dFp.pgp
Description: PGP signature
On 7/1/05, Jürgen Herrmann [EMAIL PROTECTED] wrote:
i think there should be no functional difference in the two code snippets
below, but is there any difference in performance?
Don't know, and don't care; these are (at the Python level)
functionally different.
(i know, the except
I may be asking this in the wrong place but I have a tal page where I want
to use python to display only the most recent addition to a folder of files.
I can sort the folder and return all the files easily with:
return sequence.sort(files, (('bobobase_modification_time', 'cmp',
'desc'),))
How
PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Kate Legere
Sent: Tuesday, May 31, 2005 3:35 PM
To: Zope
Subject: [Zope] python question
I may be asking this in the wrong place but I have a tal page
where I want to use python to display only the most recent
addition to a folder of files
Kate Legere wrote:
I may be asking this in the wrong place but I have a tal page where I want
to use python to display only the most recent addition to a folder of files.
I can sort the folder and return all the files easily with:
return sequence.sort(files, (('bobobase_modification_time',
Thanks - turns out the real error was in the file dealing with it - all
fixed now.
Thanks for the help.
Kate
-Original Message-
From: Jim Abramson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 31, 2005 2:38 PM
To: Kate Legere; Zope
Subject: RE: [Zope] python question
sort
Am Dienstag, den 31.05.2005, 15:34 -0400 schrieb Kate Legere:
I may be asking this in the wrong place but I have a tal page where I want
to use python to display only the most recent addition to a folder of files.
I can sort the folder and return all the files easily with:
return
Am Dienstag, den 31.05.2005, 15:38 -0400 schrieb Jim Abramson:
sort() on a sequence does not return anything. It operates on the
[mutable] sequence in place.
sequence is a module in Zope. So she indeed was right.
___
Zope maillist - Zope@zope.org
blast!
i'll keep my mouth shut til I get the library memorized.
Jim
-Original Message-
From: Tino Wildenhain [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 31, 2005 4:06 PM
To: Jim Abramson
Cc: Kate Legere; Zope
Subject: RE: [Zope] python question
Am Dienstag, den 31.05.2005
Hi,
I saw in some products a __of__ operator and looked at the python.org
for a documentation.
I didn't found one.
Can anybody tell me what the __of__ does ?
Or tell me a URL for the documentation of the __of__ operator ?
Thanks,
Dirk
___
Dirk Datzert wrote:
Hi,
I saw in some products a __of__ operator and looked at the python.org
for a documentation.
I didn't found one.
Can anybody tell me what the __of__ does ?
It creates an acquisition wrapper for the object the method belongs to,
in the context of the object you
17 matches
Mail list logo