[Zope-Checkins] SVN: Zope/trunk/lib/python/ Use mechanize 0.1.10 to catch up with 2.11 branch.
Log message for revision 94246: Use mechanize 0.1.10 to catch up with 2.11 branch. Changed: _U Zope/trunk/lib/python/ -=- Property changes on: Zope/trunk/lib/python ___ Modified: svn:externals - BTrees svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/BTrees ClientForm svn://svn.zope.org/repos/main/ClientForm/as_package/0.2.9 RestrictedPython svn://svn.zope.org/repos/main/RestrictedPython/tags/3.4.3/src/RestrictedPython ThreadedAsync svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ThreadedAsync ZConfig svn://svn.zope.org/repos/main/ZConfig/tags/2.5.1/ZConfig ZEO svn://svn.zope.org/repos/main/ZODB/branches/3.8/src/ZEO ZODB svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ZODB ZopeUndo svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ZopeUndo docutils svn://svn.zope.org/repos/main/docutils/tags/0.4.0 mechanize svn://svn.zope.org/repos/main/mechanize/tags/0.1.9/mechanize persistent svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/persistent pytz svn://svn.zope.org/repos/main/pytz/tags/2008i/pytz transaction svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/transaction zdaemon svn://svn.zope.org/repos/main/zdaemon/tags/2.0.2/src/zdaemon zodbcode svn://svn.zope.org/repos/main/zodbcode/tags/3.4.0/src/zodbcode + BTrees svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/BTrees ClientForm svn://svn.zope.org/repos/main/ClientForm/as_package/0.2.9 RestrictedPython svn://svn.zope.org/repos/main/RestrictedPython/tags/3.4.3/src/RestrictedPython ThreadedAsync svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ThreadedAsync ZConfig svn://svn.zope.org/repos/main/ZConfig/tags/2.5.1/ZConfig ZEO svn://svn.zope.org/repos/main/ZODB/branches/3.8/src/ZEO ZODB svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ZODB ZopeUndo svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ZopeUndo docutils svn://svn.zope.org/repos/main/docutils/tags/0.4.0 mechanize svn://svn.zope.org/repos/main/mechanize/tags/0.1.10/mechanize persistent svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/persistent pytz svn://svn.zope.org/repos/main/pytz/tags/2008i/pytz transaction svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/transaction zdaemon svn://svn.zope.org/repos/main/zdaemon/tags/2.0.2/src/zdaemon zodbcode svn://svn.zope.org/repos/main/zodbcode/tags/3.4.0/src/zodbcode ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-dev] Using zope.proxy for read-only instances
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 Jung n:Jung;Andreas org:ZOPYX Ltd. Co. KG adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany email;internet:i...@zopyx.com title:CEO tel;work:+49-7071-793376 tel;fax:+49-7071-7936840 tel;home:+49-7071-793257 x-mozilla-html:FALSE url:www.zopyx.com version:2.1 end:vcard ___ 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] Using zope.proxy for read-only instances
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): return getattr(obj, attribute) maybe add a check of the returned attribute is callable or so. Andreas Andreas Jung wrote: 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 ___ 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 ) signature.asc Description: OpenPGP digital 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] Using zope.proxy for read-only instances
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 def __getattr__(self, attribute): return getattr(obj, attribute) maybe add a check of the returned attribute is callable or so. Sorry, invalid answer. That's what zope.proxy is designed for and I am trying to get it working (unlikely it has no documentation and the unittest don't give me much insight). In addition: your code won't work since you must refer to self.obj not 'obj' within __getattr__. And using self.obj will lead to an infinite recursion. I also think that __getattr__() is not used by new-styles classes. Instead you need to override __getattribute__(). Andreas begin:vcard fn:Andreas Jung n:Jung;Andreas org:ZOPYX Ltd. Co. KG adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany email;internet:i...@zopyx.com title:CEO tel;work:+49-7071-793376 tel;fax:+49-7071-7936840 tel;home:+49-7071-793257 x-mozilla-html:FALSE url:www.zopyx.com version:2.1 end:vcard ___ 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] Using zope.proxy for read-only instances
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 understand better what you want to do and be helpful - which obviously is neither needed nor wanted. Andreas Sorry, invalid answer. That's what zope.proxy is designed for and I am trying to get it working (unlikely it has no documentation and the unittest don't give me much insight). In addition: your code won't work since you must refer to self.obj not 'obj' within __getattr__. And using self.obj will lead to an infinite recursion. I also think that __getattr__() is not used by new-styles classes. Instead you need to override __getattribute__(). Andreas signature.asc Description: OpenPGP digital 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] Zope Tests: 4 OK, 2 Failed
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 2008 URL: http://mail.zope.org/pipermail/zope-tests/2008-December/010697.html Subject: FAILED (failures=2) : Zope-trunk Python-2.5.2 : Linux From: Zope Tests Date: Sun Dec 21 20:38:27 EST 2008 URL: http://mail.zope.org/pipermail/zope-tests/2008-December/010698.html Tests passed OK --- Subject: OK : Zope-2.8 Python-2.3.7 : Linux From: Zope Tests Date: Sun Dec 21 20:30:56 EST 2008 URL: http://mail.zope.org/pipermail/zope-tests/2008-December/010693.html Subject: OK : Zope-2.9 Python-2.4.5 : Linux From: Zope Tests Date: Sun Dec 21 20:32:27 EST 2008 URL: http://mail.zope.org/pipermail/zope-tests/2008-December/010694.html Subject: OK : Zope-2.10 Python-2.4.5 : Linux From: Zope Tests Date: Sun Dec 21 20:33:57 EST 2008 URL: http://mail.zope.org/pipermail/zope-tests/2008-December/010695.html Subject: OK : Zope-2.11 Python-2.4.5 : Linux From: Zope Tests Date: Sun Dec 21 20:35:27 EST 2008 URL: http://mail.zope.org/pipermail/zope-tests/2008-December/010696.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] bug in zope.testing 3.7.1?
On Fri, Dec 19, 2008 at 01:37:52PM -0500, Benji York wrote: On Fri, Dec 19, 2008 at 1:03 PM, Chris Withers ch...@simplistix.co.uk 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.join(os.path.dirname(__file__),'..','docs','*.txt')): suite.addTest( DocFileSuite(path, optionflags=REPORT_NDIFF|ELLIPSIS) ) return suite Paths to doctest files are relative to the calling module (by default). To get them to accept paths relative to os.getcwd() (or absolute paths for that matter), pass module_relative=False to DocFileSuite. Also, DocFileSuite can take multiple paths, (I also always forget that.) so your function can be simplified to this: def test_suite(): paths = glob(os.path.join('..', 'docs', '*.txt')) return DocFileSuite(*paths, optionflags=REPORT_NDIFF|ELLIPSIS) (You might want to use os.path.pardir instead of '..') glob() will search relative to os.getcwd(), while DocFileSuite will search relative to os.path.dirname(__file__). The two may be different. Marius Gedminas -- http://pov.lt/ -- Zope 3 consulting and development signature.asc Description: Digital 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] Deprecate ITerms in zope.app.form? [Re:zope.browser?]
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 something has changed that doesn't result in deprecation warnings. It's clear from this discussion that this should be done upon request, not during runtime. The old import location can then stay around indefinitely. I'd like a tool that I can point at a package and it'll sort through whatever it imports and tell me which ones are not importing from the right public location. Each package should have some way to indicate to that tool whether certain imports are better made from somewhere else if one is in the business of reducing dependencies. Perhaps a # BBB comment is enough, though what it looks like exactly depends a bit on how the tool will work in the end. Regards, Martijn ___ 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] C-extension in zope.i18nmessageid
-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. If there are no objections, I will merge this into trunk shortly. I object. Please drop it. I'd rather not drop it: can we (today) justify the need for the C extension? If nothing else, that explanation needs to be added to the package docs. If the justification is support the model of untrusted code, could we not make the extension optional, and let folks who don't have that use case get by without needing to pay the price? For that matter, who actually has the use case in Z3 land? I don't know of *any* deployed applications which use persistent code, and therefore which need to worry about the problem. Certainly nothing in Zope2 land uses space suits. Tres. - -- === Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJUDBw+gerLs4ltQ4RAhLuAJ9QUhPsCaVTOZAX0z+WEO1ojutKowCgvhUO 0gEhYrnEYAVzaVh610zgH3k= =AtJt -END 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] Experiment: Pyjamas with Zope
Quick note. I found that The fix pyjamas question in my previous note could be handled with a ~100 line python module that makes a new class descending from pyjamas.HTTPRequest.HTTPRequest, but overriding asyncPostImpl with a supported content-type, e.g., application/json. The module is mostly copy-paste from pyjamas.JSONService and pyjamas.HTTPRequest, but I'll provide it to anyone interested. It was really simple to do. Kudos to pyjamas for making fixes easy. - Jim Washington ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Experiment: Pyjamas with Zope
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jim Washington wrote: Quick note. I found that The fix pyjamas question in my previous note could be handled with a ~100 line python module that makes a new class descending from pyjamas.HTTPRequest.HTTPRequest, but overriding asyncPostImpl with a supported content-type, e.g., application/json. The module is mostly copy-paste from pyjamas.JSONService and pyjamas.HTTPRequest, but I'll provide it to anyone interested. It was really simple to do. Kudos to pyjamas for making fixes easy. Please post your findings to the pyjamas ml too http://groups.google.com/group/pyjamas-dev There are already posts related to webpy and django. Would be interesting to add Zope material too. Regards Michael - -- http://blog.d2m.at http://planetzope.org -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJT5phl0uAvQJUKVYRAt4nAJ9rKAIEt1Mn5gWOfgoZdEK2vQ+nUgCeMWDs T+6CtHvCF+f95isZw7QA2cU= =nbig -END PGP SIGNATURE- ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )