[Zope-CMF] Re: [CMF-checkins] CVS: Products/CMFCore/tests/base - testcase.py:1.16
This is awesome by the way, and was sorely missing. We can now have much cleaner tests. Thanks. Florent > - Forward-ported testing framework to suppress / examine output from >warnings module and from zLOG from 1.5 branch. > > > === Products/CMFCore/tests/base/testcase.py 1.15 => 1.16 === > --- Products/CMFCore/tests/base/testcase.py:1.15 Wed Jun 15 10:17:38 2005 > +++ Products/CMFCore/tests/base/testcase.py Fri Jul 15 22:31:02 2005 > + > +class LogInterceptor: > + > +class WarningInterceptor: > + -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Re: [CMF-checkins] CVS: Products/CMFCore - ActionInformation.py:1.26.2.5
On 16 Jul 2005, at 15:18, Stefan H. Holek wrote: Don't be scared, I checked in a whole bunch of tests too. ;-) The problem we have is that CMF evaluates permissions for 'object' and 'workflow' actions in the object context, and 'folder' actions in the folder context. Other action categories are evaluated in the context of the portal, which is rarely useful. Plone has 'document' actions and we need permissions checked on the object, not the portal. It is a one line change (with 4 tests). If you really don't want it, we will have to resort to monkey patching ActionInfo. Nah, I'm not going to give you grief about it, it just violates the "nothing but severe bug fixes" policy so soon before the release. This has a limited-enough scope, I just wanted to know what it was for. You'll have more freedom again after I roll the 1.5.2 release tomorrow... jens ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Re: [CMF-checkins] CVS: Products/CMFCore - ActionInformation.py:1.26.2.5
Don't be scared, I checked in a whole bunch of tests too. ;-) The problem we have is that CMF evaluates permissions for 'object' and 'workflow' actions in the object context, and 'folder' actions in the folder context. Other action categories are evaluated in the context of the portal, which is rarely useful. Plone has 'document' actions and we need permissions checked on the object, not the portal. It is a one line change (with 4 tests). If you really don't want it, we will have to resort to monkey patching ActionInfo. http://plone.org/collector/3155 Stefan On 16. Jul 2005, at 14:20, Jens Vagelpohl wrote: On 16 Jul 2005, at 14:15, Stefan H. Holek wrote: Update of /cvs-repository/Products/CMFCore In directory cvs.zope.org:/tmp/cvs-serv12386/CMFCore Modified Files: Tag: CMF-1_5-branch ActionInformation.py Log Message: CMFCore/ActionInformation.py: Permissions of action categories starting with 'document' are now evaluated in the object context instead of the portal context. This should probably be generalized some more. Could you explain a bit more what problem this is solving? Check- ins into the branch a day before a final production version is released with insufficient problem descriptions that do not seem to be critical bugfixes to CMF scare me. A lot. jens -- Software Engineering is Programming when you can't. --E. W. Dijkstra ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Re: [CMF-checkins] CVS: Products/CMFCore - ActionInformation.py:1.26.2.5
On 16 Jul 2005, at 14:15, Stefan H. Holek wrote: Update of /cvs-repository/Products/CMFCore In directory cvs.zope.org:/tmp/cvs-serv12386/CMFCore Modified Files: Tag: CMF-1_5-branch ActionInformation.py Log Message: CMFCore/ActionInformation.py: Permissions of action categories starting with 'document' are now evaluated in the object context instead of the portal context. This should probably be generalized some more. Could you explain a bit more what problem this is solving? Check-ins into the branch a day before a final production version is released with insufficient problem descriptions that do not seem to be critical bugfixes to CMF scare me. A lot. jens ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Re: [CMF-checkins] CVS: Products/CMFCore - PortalFolder.py:1.82
I guess on HEAD we could start using super() as we're targetting Zope 2.8 now... Or would that be gratuitous backward non-compatibility ? Florent Tres Seaver <[EMAIL PROTECTED]> wrote: > Modified Files: > PortalFolder.py > Log Message: > - Forward-port Tiran's new base class, PortalFolderBase. > > > === Products/CMFCore/PortalFolder.py 1.81 => 1.82 === > def _checkId(self, id, allow_dup=0): > -PortalFolder.inheritedAttribute('_checkId')(self, id, allow_dup) > +PortalFolderBase.inheritedAttribute('_checkId')(self, id, allow_dup) > > if allow_dup: > return > @@ -485,7 +474,7 @@ > > # Call OFS' _verifyObjectPaste if necessary > if not securityChecksDone: > -PortalFolder.inheritedAttribute( > +PortalFolderBase.inheritedAttribute( > '_verifyObjectPaste')(self, object, validate_src) > -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Re: [CMF-checkins] CVS: Products/CMFCore - FSImage.py:1.14.18.7
Is this actually a fix for http://www.zope.org/Collectors/CMF/333 as opposed to 355? On Wed, 2005-06-08 at 09:16 -0400, Tres Seaver wrote: > Update of /cvs-repository/Products/CMFCore > In directory cvs.zope.org:/tmp/cvs-serv12605/CMFCore > > Modified Files: > Tag: CMF-1_4-branch > FSImage.py > Log Message: > > > - Set cache headers in 304 responses from FSImage / FSFile > (http://zope.org/Collectors/355) > > > === Products/CMFCore/FSImage.py 1.14.18.6 => 1.14.18.7 === > --- Products/CMFCore/FSImage.py:1.14.18.6 Mon Apr 25 16:06:49 2005 > +++ Products/CMFCore/FSImage.py Wed Jun 8 09:15:49 2005 > @@ -94,8 +94,11 @@ > """ > self._updateFromFS() > data = self._data > +data_len = len(data) > +last_mod = self._file_mod_time > +status = 200 > # HTTP If-Modified-Since header handling. > -header=REQUEST.get_header('If-Modified-Since', None) > +header = REQUEST.get_header('If-Modified-Since', None) > if header is not None: > header=string.split(header, ';')[0] > # Some proxies seem to send invalid date strings for this > @@ -104,26 +107,26 @@ > # with common servers such as Apache (which can usually > # understand the screwy date string as a lucky side effect > # of the way they parse it). > -try:mod_since=long(DateTime(header).timeTime()) > -except: mod_since=None > +try: > +mod_since = long(DateTime(header).timeTime()) > +except: > +mod_since = None > + > if mod_since is not None: > -last_mod = self._file_mod_time > if last_mod > 0 and last_mod <= mod_since: > -# Set header values since apache caching will return > -# Content-Length of 0 in response if size is not set here > -RESPONSE.setHeader('Last-Modified', > rfc1123_date(last_mod)) > -RESPONSE.setHeader('Content-Type', self.content_type) > -RESPONSE.setHeader('Content-Length', len(data)) > -RESPONSE.setStatus(304) > -return '' > +status = 304 > +data = '' > > -#Last-Modified will get stomped on by a cache policy it there is one > set > -RESPONSE.setHeader('Last-Modified', > rfc1123_date(self._file_mod_time)) > +#Last-Modified will get stomped on by a cache policy it there is > +#one set > +RESPONSE.setStatus(status) > +RESPONSE.setHeader('Last-Modified', rfc1123_date(last_mod)) > RESPONSE.setHeader('Content-Type', self.content_type) > -RESPONSE.setHeader('Content-Length', len(data)) > +RESPONSE.setHeader('Content-Length', data_len) > > -#There are 2 Cache Managers which can be in playneed to decide > which to use > -#to determine where the cache headers are decided on. > +#There are 2 Cache Managers which can be in play > +#need to decide which to use to determine where the cache headers > +#are decided on. > if self.ZCacheable_getManager() is not None: > self.ZCacheable_set(None) > else: > > ___ > CMF-checkins mailing list > CMF-checkins@zope.org > http://mail.zope.org/mailman/listinfo/cmf-checkins > ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
Re: [Zope-CMF] Re: [CMF-checkins] CVS: Products/CMFCore - DirectoryView.py:1.47.2.7
Dieter Maurer wrote: You asked for this a long time ago and I responded (a long time ago!): You turn the warning (all of them, if you like) into exceptions and you get a nice traceback. You find details in the description of the Python (command) options or the module "warnings". OK. Thanks. Having had a hunt around, I see there's also a Zope.conf section for this... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
Re: [Zope-CMF] Re: [CMF-checkins] CVS: Products/CMFCore - DirectoryView.py:1.47.2.7
Chris Withers wrote at 2005-5-26 08:12 +0100: > ... >My personal hate of it comes from seeing a thoroughly useless warning >coming from the old SearchIndex stuff for years and never being able to >figure out exactly what was causing the problem. You asked for this a long time ago and I responded (a long time ago!): You turn the warning (all of them, if you like) into exceptions and you get a nice traceback. You find details in the description of the Python (command) options or the module "warnings". -- Dieter ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Re: [CMF-checkins] CVS: Products/CMFCore - DirectoryView.py:1.47.2.7
yuppie wrote: Can you please tell us *why* you hate it? warnings.warn is used in many places, so if there is a good reason not to use it other code should be changed as well. Well, personally, I find it opaque and useless, why isn't it just a log call? My personal hate of it comes from seeing a thoroughly useless warning coming from the old SearchIndex stuff for years and never being able to figure out exactly what was causing the problem. I guess at least in this case, at least fairly useful information is being "warned"? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
Re: [Zope-CMF] Re: [CMF-checkins] CVS: Products/CMFCore - DirectoryView.py:1.47.2.7
Hi Florent, Florent Guillaume wrote: I deliberately didn't use a LOG call, because this line will get executed for every request if there is an old directory view present, and it'll fill your logs pretty quickly, which is not acceptable. Well, what's acceptable or not is a matter of opinion ;-) Disk space is cheap and I don't mind logs filling up with this, as it's a good sign it needs fixing quickly. Using warn was the quickest alternative that worked, if you have something better... So are you saying that warn will only emit the warning once no matter how many times it's called? Interesting, that might explain the existence of this otherwise apparently meaningless module in the python standard lib ;-) If that IS the case, how do I get warning messages to be copied to the event log? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
Re: [Zope-CMF] Re: [CMF-checkins] CVS: Products/CMFCore - DirectoryView.py:1.47.2.7
Chris Withers <[EMAIL PROTECTED]> wrote: > Florent Guillaume wrote: > > +warn('DirectoryView %s refers to a non-existing path %s' > > + % (self.id, dirpath), UserWarning) > > Urg. I hate the warn module, anyone object if I change that to a normal > logging call? I deliberately didn't use a LOG call, because this line will get executed for every request if there is an old directory view present, and it'll fill your logs pretty quickly, which is not acceptable. Using warn was the quickest alternative that worked, if you have something better... Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Re: [CMF-checkins] CVS: Products/CMFCore - DirectoryView.py:1.47.2.7
Chris Withers wrote: Florent Guillaume wrote: +warn('DirectoryView %s refers to a non-existing path %s' + % (self.id, dirpath), UserWarning) Urg. I hate the warn module, anyone object if I change that to a normal logging call? Can you please tell us *why* you hate it? warnings.warn is used in many places, so if there is a good reason not to use it other code should be changed as well. Cheers, Yuppie ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Re: [CMF-checkins] CVS: Products/CMFCore - DirectoryView.py:1.47.2.7
Florent Guillaume wrote: +warn('DirectoryView %s refers to a non-existing path %s' + % (self.id, dirpath), UserWarning) Urg. I hate the warn module, anyone object if I change that to a normal logging call? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests
[Zope-CMF] Re: [CMF-checkins] CVS: Products/CMFCore
Yvo Schubbe wrote: > === Products/CMFCore/CatalogTool.py 1.55.2.4 => 1.55.2.5 === > --- Products/CMFCore/CatalogTool.py:1.55.2.4 Fri Mar 25 12:16:58 2005 > +++ Products/CMFCore/CatalogTool.py Thu Apr 7 12:37:46 2005 > @@ -249,8 +247,8 @@ > if kw.has_key(k): > range = kw[k]['range'] or '' > query = kw[k]['query'] > -if (not isinstance(query, TupleType) and > -not isinstance(query, ListType)): > +if (not isinstance(query, tuple) and > +not isinstance(query, list)): > query = (query,) > else: > range = '' Here you can actually use: if not isinstance(query, (tuple, list)): Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests