Re: [Checkins] SVN: Zope/branches/Zope-2_8-branch/ - Backport a postonly decorator from Zope trunk's requestmethod decorator factory.
Python 2.3 does not support the @decorator syntax. Cheers, Stefan On 20. Mär 2007, at 10:05, Martijn Pieters wrote:
Log message for revision 73390: - Backport a postonly decorator from Zope trunk's requestmethod decorator factory. - Protect various security-setting-mutators with this decorator.
Modified: Zope/branches/Zope-2_8-branch/lib/python/AccessControl/ PermissionMapping.py =================================================================== --- Zope/branches/Zope-2_8-branch/lib/python/AccessControl/ PermissionMapping.py 2007-03-20 09:03:57 UTC (rev 73389) +++ Zope/branches/Zope-2_8-branch/lib/python/AccessControl/ PermissionMapping.py 2007-03-20 09:05:56 UTC (rev 73390) @@ -26,10 +26,13 @@
from Owned import UnownableOwner from Permission import pname +from requestmethod import postonly
class RoleManager:
+ # XXX: No security declarations? + def manage_getPermissionMapping(self): """Return the permission mapping for the object
@@ -54,6 +57,7 @@ a({'permission_name': ac_perms[0], 'class_permission': p}) return r
+ @postonly def manage_setPermissionMapping(self, permission_names=[], class_permissions=[], REQUEST=None):
-- Anything that, in happening, causes something else to happen, causes something else to happen. --Douglas Adams
On 3/21/07, Stefan H. Holek <stefan@epy.co.at> wrote:
Python 2.3 does not support the @decorator syntax.
My bad, I'll fix. -- Martijn Pieters
On 3/21/07, Martijn Pieters <mj@zopatista.com> wrote:
On 3/21/07, Stefan H. Holek <stefan@epy.co.at> wrote:
Python 2.3 does not support the @decorator syntax.
My bad, I'll fix.
Done. I hadn't even properly run the tests on the 2.8 branch, which would would also have shown that doctest on py 2.3 doesn't have any unittest integration. -- Martijn Pieters
Martijn Pieters wrote:
On 3/21/07, Martijn Pieters <mj@zopatista.com> wrote:
On 3/21/07, Stefan H. Holek <stefan@epy.co.at> wrote:
Python 2.3 does not support the @decorator syntax.
My bad, I'll fix.
Done. I hadn't even properly run the tests on the 2.8 branch, which would would also have shown that doctest on py 2.3 doesn't have any unittest integration.
But there's zope.testing.doctest which fixes that. It's a drop-in replacement for the doctest module (in fact, it's the one from Python 2.4). You probably want to use that instead of deleting the test case ;). -- http://worldcookery.com -- Professional Zope documentation and training
On 3/21/07, Philipp von Weitershausen <philipp@weitershausen.de> wrote:
Done. I hadn't even properly run the tests on the 2.8 branch, which would would also have shown that doctest on py 2.3 doesn't have any unittest integration.
But there's zope.testing.doctest which fixes that. It's a drop-in replacement for the doctest module (in fact, it's the one from Python 2.4). You probably want to use that instead of deleting the test case ;).
W00t! Didn't know about that one, thanks! Test re-instated. -- Martijn Pieters
participants (3)
-
Martijn Pieters -
Philipp von Weitershausen -
Stefan H. Holek