[Zope-dev] Using zope.proxy for read-only instances

2008-12-22 Thread Andreas Jung
Hi there, I am trying to figure out how to use zope.proxy for creating read-only proxy objects of arbitrary Python objects where only attributes can be accessed read-only (no write access to attributes, no calling of methods). Anyone with some example code? Andreas begin:vcard fn:Andreas Ju

Re: [Zope-dev] Using zope.proxy for read-only instances

2008-12-22 Thread Andreas Kopecky
Hi, My first question regarding that would be: why use zope.proxy for it. Personally - not knowing what exactly you have in mind ofc - i'd use something along the lines of class Proxy(object): def __init__(self, obj): self.obj = obj def __getattr__(self, attribute): retu

Re: [Zope-dev] Using zope.proxy for read-only instances

2008-12-22 Thread Andreas Jung
On 22.12.2008 11:34 Uhr, Andreas Kopecky wrote: Hi, My first question regarding that would be: why use zope.proxy for it. Personally - not knowing what exactly you have in mind ofc - i'd use something along the lines of class Proxy(object): def __init__(self, obj): self.obj = obj

Re: [Zope-dev] Using zope.proxy for read-only instances

2008-12-22 Thread Andreas Kopecky
Hi, Well if it's invalid i won't bother with it but say: - i forgot a self - that is true - if added it does NOT loop infinitely - its not my example its taken from python cookbook - it works with new style objects - __getattribute__ does something different But frankly i was only trying to un

[Zope-dev] Zope Tests: 4 OK, 2 Failed

2008-12-22 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list. Period Sun Dec 21 12:00:00 2008 UTC to Mon Dec 22 12:00:00 2008 UTC. There were 6 messages: 6 from Zope Tests. Test failures - Subject: FAILED (failures=2) : Zope-trunk Python-2.4.5 : Linux From: Zope Tests Date: Sun Dec 21 20:36:57 EST 200

Re: [Zope-dev] bug in zope.testing 3.7.1?

2008-12-22 Thread Marius Gedminas
On Fri, Dec 19, 2008 at 01:37:52PM -0500, Benji York wrote: > On Fri, Dec 19, 2008 at 1:03 PM, Chris Withers wrote: > > I have the following code that runs the tests in all my package's docs: > > > > def test_suite(): > > suite = unittest.TestSuite() > > for path in \ > > glob(os.path

Re: [Zope-dev] Deprecate ITerms in zope.app.form? [Re:zope.browser?]

2008-12-22 Thread Martijn Faassen
Hi there, All right, I was getting a bit confused when it appeared you were arguing against moving things at all, but you're basically in favor of leaving the old APIs intact without explicitly breaking them. I think we need to think of some way to signal that the "preferred import location" of s

Re: [Zope-dev] C-extension in zope.i18nmessageid

2008-12-22 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim Fulton wrote: > On Dec 12, 2008, at 6:28 AM, Malthe Borch wrote: > >> I've branched out this package and removed the C-extension. It's not >> documented in the package why a C-extension is needed or >> alternatively, >> what it benefits. >> >> I