[Zope-Checkins] SVN: Zope/branches/2.9/ Collector #2287: form ':record' objects did not implement enough of the mapping protocol.
Log message for revision 79911: Collector #2287: form ':record' objects did not implement enough of the mapping protocol. Changed: U Zope/branches/2.9/doc/CHANGES.txt U Zope/branches/2.9/lib/python/ZPublisher/HTTPRequest.py U Zope/branches/2.9/lib/python/ZPublisher/tests/testHTTPRequest.py -=- Modified: Zope/branches/2.9/doc/CHANGES.txt === --- Zope/branches/2.9/doc/CHANGES.txt 2007-09-24 21:04:11 UTC (rev 79910) +++ Zope/branches/2.9/doc/CHANGES.txt 2007-09-24 21:04:22 UTC (rev 79911) @@ -8,6 +8,9 @@ Bugs fixed + - Collector #2287: form ':record' objects did not implement enough +of the mapping protocol. + - Collector #2346: username logging in FCGI crashed the server - Collector #2332: SessionDataManger: don't swallow ConflictErrors Modified: Zope/branches/2.9/lib/python/ZPublisher/HTTPRequest.py === --- Zope/branches/2.9/lib/python/ZPublisher/HTTPRequest.py 2007-09-24 21:04:11 UTC (rev 79910) +++ Zope/branches/2.9/lib/python/ZPublisher/HTTPRequest.py 2007-09-24 21:04:22 UTC (rev 79911) @@ -1515,7 +1515,7 @@ _guarded_writes = 1 def __getattr__(self, key, default=None): -if key in ('get', 'keys', 'items', 'values', 'copy', 'has_key'): +if key in ('get', 'keys', 'items', 'values', 'copy', 'has_key', '__contains__', '__iter__', '__len__'): return getattr(self.__dict__, key) raise AttributeError, key Modified: Zope/branches/2.9/lib/python/ZPublisher/tests/testHTTPRequest.py === --- Zope/branches/2.9/lib/python/ZPublisher/tests/testHTTPRequest.py 2007-09-24 21:04:11 UTC (rev 79910) +++ Zope/branches/2.9/lib/python/ZPublisher/tests/testHTTPRequest.py 2007-09-24 21:04:22 UTC (rev 79911) @@ -77,7 +77,29 @@ d = eval( r ) self.assertEqual( d, record.__dict__ ) +def test_contains(self): +from ZPublisher.HTTPRequest import record +record = record() +record.a = 1 +self.assertTrue('a' in record) +def test_iter(self): +from ZPublisher.HTTPRequest import record +record = record() +record.a = 1 +record.b = 2 +record.c = 3 +for k in record: +self.assertTrue(k in ('a','b','c')) + +def test_len(self): +from ZPublisher.HTTPRequest import record +record = record() +record.a = 1 +record.b = 2 +record.c = 3 +self.assertEqual(len(record), 3) + class ProcessInputsTests(unittest.TestCase): def _getHTTPRequest(self, env): from ZPublisher.HTTPRequest import HTTPRequest ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.10/ Collector #2287: form ':record' objects did not implement enough of the mapping interface.
Log message for revision 79912: Collector #2287: form ':record' objects did not implement enough of the mapping interface. Changed: U Zope/branches/2.10/doc/CHANGES.txt U Zope/branches/2.10/lib/python/ZPublisher/HTTPRequest.py U Zope/branches/2.10/lib/python/ZPublisher/tests/testHTTPRequest.py -=- Modified: Zope/branches/2.10/doc/CHANGES.txt === --- Zope/branches/2.10/doc/CHANGES.txt 2007-09-24 21:04:22 UTC (rev 79911) +++ Zope/branches/2.10/doc/CHANGES.txt 2007-09-24 21:06:48 UTC (rev 79912) @@ -8,6 +8,9 @@ Bugs fixed + - Collector #2287: form ':record' objects did not implement enough of +the mapping interface. + - Collector #2352: fix in OFS.Traversable - Collector #2346: username logging in FCGI crashed the server Modified: Zope/branches/2.10/lib/python/ZPublisher/HTTPRequest.py === --- Zope/branches/2.10/lib/python/ZPublisher/HTTPRequest.py 2007-09-24 21:04:22 UTC (rev 79911) +++ Zope/branches/2.10/lib/python/ZPublisher/HTTPRequest.py 2007-09-24 21:06:48 UTC (rev 79912) @@ -1529,7 +1529,7 @@ _guarded_writes = 1 def __getattr__(self, key, default=None): -if key in ('get', 'keys', 'items', 'values', 'copy', 'has_key'): +if key in ('get', 'keys', 'items', 'values', 'copy', 'has_key', '__contains__', '__iter__', '__len__'): return getattr(self.__dict__, key) raise AttributeError, key Modified: Zope/branches/2.10/lib/python/ZPublisher/tests/testHTTPRequest.py === --- Zope/branches/2.10/lib/python/ZPublisher/tests/testHTTPRequest.py 2007-09-24 21:04:22 UTC (rev 79911) +++ Zope/branches/2.10/lib/python/ZPublisher/tests/testHTTPRequest.py 2007-09-24 21:06:48 UTC (rev 79912) @@ -77,7 +77,29 @@ d = eval( r ) self.assertEqual( d, record.__dict__ ) +def test_contains(self): +from ZPublisher.HTTPRequest import record +record = record() +record.a = 1 +self.assertTrue('a' in record) +def test_iter(self): +from ZPublisher.HTTPRequest import record +record = record() +record.a = 1 +record.b = 2 +record.c = 3 +for k in record: +self.assertTrue(k in ('a','b','c')) + +def test_len(self): +from ZPublisher.HTTPRequest import record +record = record() +record.a = 1 +record.b = 2 +record.c = 3 +self.assertEqual(len(record), 3) + class ProcessInputsTests(unittest.TestCase): def _getHTTPRequest(self, env): from ZPublisher.HTTPRequest import HTTPRequest ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/trunk/ Collector #2278: form ':record' objects did not implement enough of the mapping protocol.
Log message for revision 79930: Collector #2278: form ':record' objects did not implement enough of the mapping protocol. Changed: U Zope/trunk/doc/CHANGES.txt U Zope/trunk/lib/python/ZPublisher/HTTPRequest.py U Zope/trunk/lib/python/ZPublisher/tests/testHTTPRequest.py -=- Modified: Zope/trunk/doc/CHANGES.txt === --- Zope/trunk/doc/CHANGES.txt 2007-09-24 21:59:36 UTC (rev 79929) +++ Zope/trunk/doc/CHANGES.txt 2007-09-24 22:11:21 UTC (rev 79930) @@ -158,6 +158,9 @@ Bugs Fixed + - Collector #2278: form ':record' objects did not implement enough +of the mapping protocol. + - Collector #2352: fix in OFS.Traversable - Collector #2346: username logging in FCGI crashed the server Modified: Zope/trunk/lib/python/ZPublisher/HTTPRequest.py === --- Zope/trunk/lib/python/ZPublisher/HTTPRequest.py 2007-09-24 21:59:36 UTC (rev 79929) +++ Zope/trunk/lib/python/ZPublisher/HTTPRequest.py 2007-09-24 22:11:21 UTC (rev 79930) @@ -1558,7 +1558,7 @@ _guarded_writes = 1 def __getattr__(self, key, default=None): -if key in ('get', 'keys', 'items', 'values', 'copy', 'has_key'): +if key in ('get', 'keys', 'items', 'values', 'copy', 'has_key', '__contains__', '__iter__', '__len__'): return getattr(self.__dict__, key) raise AttributeError, key Modified: Zope/trunk/lib/python/ZPublisher/tests/testHTTPRequest.py === --- Zope/trunk/lib/python/ZPublisher/tests/testHTTPRequest.py 2007-09-24 21:59:36 UTC (rev 79929) +++ Zope/trunk/lib/python/ZPublisher/tests/testHTTPRequest.py 2007-09-24 22:11:21 UTC (rev 79930) @@ -86,7 +86,29 @@ d = eval( r ) self.assertEqual( d, record.__dict__ ) +def test_contains(self): +from ZPublisher.HTTPRequest import record +record = record() +record.a = 1 +self.assertTrue('a' in record) +def test_iter(self): +from ZPublisher.HTTPRequest import record +record = record() +record.a = 1 +record.b = 2 +record.c = 3 +for k in record: +self.assertTrue(k in ('a','b','c')) + +def test_len(self): +from ZPublisher.HTTPRequest import record +record = record() +record.a = 1 +record.b = 2 +record.c = 3 +self.assertEqual(len(record), 3) + class ProcessInputsTests(unittest.TestCase): def _getHTTPRequest(self, env): from ZPublisher.HTTPRequest import HTTPRequest ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-dev] Zope Tests: 5 OK
Summary of messages to the zope-tests list. Period Sun Sep 23 12:00:00 2007 UTC to Mon Sep 24 12:00:00 2007 UTC. There were 5 messages: 5 from Zope Unit Tests. Tests passed OK --- Subject: OK : Zope-2.7 Python-2.3.6 : Linux From: Zope Unit Tests Date: Sun Sep 23 20:51:35 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-September/008386.html Subject: OK : Zope-2.8 Python-2.3.6 : Linux From: Zope Unit Tests Date: Sun Sep 23 20:53:05 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-September/008387.html Subject: OK : Zope-2.9 Python-2.4.4 : Linux From: Zope Unit Tests Date: Sun Sep 23 20:54:35 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-September/008388.html Subject: OK : Zope-2.10 Python-2.4.4 : Linux From: Zope Unit Tests Date: Sun Sep 23 20:56:05 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-September/008389.html Subject: OK : Zope-trunk Python-2.4.4 : Linux From: Zope Unit Tests Date: Sun Sep 23 20:57:36 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-September/008390.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] Re: How to publish Zope2 products on PyPI
Philipp von Weitershausen wrote at 2007-9-23 19:24 +0200: On 23 Sep 2007, at 19:05 , Dieter Maurer wrote: Philipp von Weitershausen wrote at 2007-9-22 19:27 +0200: ... Dieter Maurer wrote: ... * PyPI doesn't necessarily have to contain eggs. It's primarily a discovery mechanism for humans. The fact that setuptools can download packages from it is not as important as the fact that developers can find packages there. The reason why I had to promiss to make my products available via PyPI was that they can be downloaded from there. Right. So then I don't understand why need all that extra machinery in Zope and an extra namespace. Others already have pointed out, that the namespace already exists in PyPI: Products. It was not obvious ;-) I am fine with this. all that extra machinery means a declaration additional-product[s] -- something I have learned meanwhile exists already in Five as registerProduct. I explain below why I think Five is not the proper place. Thus, the functionality is there -- just maybe in the wrong place. If Five's registerPackage functionality is what you had been proposing all along, then I have been misunderstanding you terribly. Either way, you don't elaborate on why you think that this is the wrong place for it. I personally consider registerPackage a solutino for integrating new software (Zope 3-style software in Python packages) into a legacy discovery mechanism (the automatic Products.* loading). I have already sketched my reason why I deem Five the wrong place to a registerProduct. I repeat it again: * Five is the vehicle to make Zope 3 concepts available in Zope 2. A product is a Zope 2 concept. Zope 3 does not have it. Thus why, what has Five to do with Zope 2 products? * zope.conf has already a declaration that controls which products are used by an instance products. When we need another one (I do feel this need), I would have put it there, in zope.conf, where already the other declaration lives -- and not in Five. Having one declaration in zope.conf and one in Five looks like bad design for me... -- 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 )
[Zope-dev] Re: Mixing recipes (zc.recipe.cmmi reuse)
On Sep 18, 2007, at 6:25 PM, Sidnei da Silva wrote: Hi there, Not sure this is the right list, but let's give it a try. I would like to use the 'patches' functionality from zc.recipe.cmmi together with other recipes. I believe this is useful functionality and is interesting to all sorts of recipes, not only to cmmi-based ones. So the question is, does the zc.buildout architecture support reusing options from a recipe on other recipes? It is just Python. Buildout doesn't provide any support fro this because it isn't really needed. Or would it require the recipe writer to explicitly 'subclass' (?) cmmi to get patch functionality? I prefer composition. A number of recipes reuse the egg recipe through composition. Generally, an egg will need to explicitly provide a Python API for other eggs. See, for example, http://pypi.python.org/pypi/ zc.recipe.egg/1.0.0b6#egg-recipe-api-for-other-recipes Or even, would a 'post-fetch'/'pre-build' generalization be desired, 'patch' being one such application? I have no idea what that is. :) Jim -- Jim Fulton Zope Corporation ___ 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: Mixing recipes (zc.recipe.cmmi reuse)
On 9/24/07, Jim Fulton [EMAIL PROTECTED] wrote: Or would it require the recipe writer to explicitly 'subclass' (?) cmmi to get patch functionality? I prefer composition. A number of recipes reuse the egg recipe through composition. Generally, an egg will need to explicitly provide a Python API for other eggs. See, for example, http://pypi.python.org/pypi/ zc.recipe.egg/1.0.0b6#egg-recipe-api-for-other-recipes Gotcha, that makes sense. Or even, would a 'post-fetch'/'pre-build' generalization be desired, 'patch' being one such application? I have no idea what that is. :) My intent is: Given any recipe, no matter where data is coming from (be it an egg in PyPI, a Subversion checkout or a tarball), I would like to be able to perform an operation in the 'local copy' of the data, without depending on the person that wrote the recipe to have allowed me to do so An example being, after a recipe that does a Subversion checkout runs, my custom operation kicks in and applies a patch to the local copy before the buildout processing continues. I believe that this might be doable today by writing custom configuration, but maybe it's such a common case that could be simplified. Maybe something along the lines of (note: this is all pseudo-config): [Step1] recipe = some.recipe.checkout url = svn://url-to-repo/package [Step2] recipe = zc.recipe.cmmi source = {Step1:location} patch = /path/to/my/patch [zope2] products = {Step2:location} I believe that something like this might already work today, if not it might be easy to make it work that way. But what I'm after is to avoid Step2 above by listing the patch to be applied in Step1 even if 'some.recipe.checkout' does not support the 'patch' option directly. All in all, if you tell me that the hypotetical Step2 above really can't be avoided and that the best option is to make 'some.recipe.checkout' and any other recipes out support the 'patch' option directly, I would be fine with that too. Does it make more sense now? -- Sidnei da Silva Enfold Systemshttp://enfoldsystems.com Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214 ___ 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: Mixing recipes (zc.recipe.cmmi reuse)
Sidnei da Silva wrote: My intent is: Given any recipe, no matter where data is coming from (be it an egg in PyPI, a Subversion checkout or a tarball), I would like to be able to perform an operation in the 'local copy' of the data, without depending on the person that wrote the recipe to have allowed me to do so An example being, after a recipe that does a Subversion checkout runs, my custom operation kicks in and applies a patch to the local copy before the buildout processing continues. I believe that this might be doable today by writing custom configuration, but maybe it's such a common case that could be simplified. Maybe something along the lines of (note: this is all pseudo-config): [Step1] recipe = some.recipe.checkout url = svn://url-to-repo/package [Step2] recipe = zc.recipe.cmmi source = {Step1:location} Do ${Step1:location} patch = /path/to/my/patch [zope2] products = {Step2:location} I believe that something like this might already work today, It does. Again, this is just Python. You have a dict-like variable 'buildout' passed to your recipe's __init__(). This has keys for each section, which contains a dict with keys for each option. So above, you could address buildout['Step1']['url'], say. You can also put things into this dict-of-dicts. Once a recipe has been run, subsequent recipes will be able to see things put into the dict. if not it might be easy to make it work that way. But what I'm after is to avoid Step2 above by listing the patch to be applied in Step1 even if 'some.recipe.checkout' does not support the 'patch' option directly. How would you avoid naming conflicts? How would you declare where that option comes from? I really don't think the overhead of having to specify a new recipe (as in your Step2 above) is very much, and it's a lot more explicit. All in all, if you tell me that the hypotetical Step2 above really can't be avoided and that the best option is to make 'some.recipe.checkout' and any other recipes out support the 'patch' option directly, I would be fine with that too. I'd suggest that's the best way. Only a limited number of recipes would really need 'path' - those could re-use your patch recipe via composition if necessary, but you have a fallback of using the recipe on its own. Martin -- Acquisition is a jealous mistress ___ 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] Re: How to know what are zope doing now?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Garito wrote: Sorry! This appear in the event.log: 2007-09-23T18:13:33 ERROR Zope Couldn't install ZopeProfiler Traceback (most recent call last): File /usr/lib/zope2.9/lib/python/OFS/Application.py, line 755, in install_product global_dict, global_dict, silly) File /var/lib/zope2.9/instance/Yanged/Products/ZopeProfiler/__init__.py, line 2, in ? from ZopeProfiler import _hookZServerPublisher, _initializeModule, \ File /var/lib/zope2.9/instance/Yanged/Products/ZopeProfiler/ZopeProfiler.py, line 66, in ? from DMprofile import Stats File /var/lib/zope2.9/instance/Yanged/Products/ZopeProfiler/DMprofile/__init__.py, line 9, in ? from DMstats import Stats File /var/lib/zope2.9/instance/Yanged/Products/ZopeProfiler/DMprofile/DMstats.py, line 13, in ? from pstats import Stats as pStats ImportError: No module named pstats How can I install pstats? Seems like you are running with a distro-packaged version of Python, which strips out the development packages / tools. Either build your own Python for running Zope from source (you will avoid future pain when your sysadmin upgrades Python without telling you), or get the sysadmin to add the 'python-dev' or 'python-devel' package. Tres. - -- === Tres Seaver +1 540-429-0999 [EMAIL PROTECTED] 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 iD8DBQFG9+GE+gerLs4ltQ4RAvCfAKDXrHMP5K2usQl/Z6SNj556tEenUwCg0V12 yKJ0/P57A6xjneTbWDCpRPA= =vjMW -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 )
Re: [Zope] Re: How to know what are zope doing now?
Garito wrote at 2007-9-23 18:17 +0200: ... 2007-09-23T18:13:33 ERROR Zope Couldn't install ZopeProfiler Traceback (most recent call last): ... line 9, in ? from DMstats import Stats File /var/lib/zope2.9/instance/Yanged/Products/ZopeProfiler/DMprofile/DMstats.py, line 13, in ? from pstats import Stats as pStats ImportError: No module named pstats How can I install pstats? pstats is a standard Python module and should come in Python's runtime library. If it is not there, then your Python installation is scrwed up -- Dieter ___ 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] Re: How to know what are zope doing now?
Yes, I installed Zope with an Ubuntu package But I try: sudo apt-get install python2.4-dev And the errors is still raised Any suggestion for a linux newbie? Thanks! 2007/9/24, Dieter Maurer [EMAIL PROTECTED]: Garito wrote at 2007-9-23 18:17 +0200: ... 2007-09-23T18:13:33 ERROR Zope Couldn't install ZopeProfiler Traceback (most recent call last): ... line 9, in ? from DMstats import Stats File /var/lib/zope2.9/instance/Yanged/Products/ZopeProfiler/DMprofile/DMstats.py, line 13, in ? from pstats import Stats as pStats ImportError: No module named pstats How can I install pstats? pstats is a standard Python module and should come in Python's runtime library. If it is not there, then your Python installation is scrwed up -- Dieter -- Mis Cosas http://blogs.sistes.net/Garito ___ 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 )