[Zope-CMF] Re: Generic Setup Delta Profiles
On 2/16/07, yuppie <[EMAIL PROTECTED]> wrote: Hi Matt! Matt wrote: > > On 2/14/07, yuppie wrote: >> >> What kind of XML diff do you have in mind? Which libraries would this >> depend on? > > I guess I had something in mind along the lines of being able to > represent an algebra (maybe a form of set algebra) for profiles. > > So at a broad level maybe something like: > > intersection(a,b) > union(a,b) > intersection(a.skins.layers,b.skins.layers) > union(a,b) - intersection(b,c) > ... these haven't been well thought out. So "union(base, extension)" would apply the extension profile to the base profile? And "snapshot - base" would create a diff between a snapshot and a base profile, so that union(base, diff) would be the same as the snapshot? yes > Considering order is important in various places, then these amount to > fragments of comparison rather than single element by element > comparison, which is sort of amounting to your idea of lots of small > files and layers. > > So this is different than a line by line diff of canonical forms. I still don't understand what your diffs look like. Are they XSLT files? The output of the algebra would not be diffs per say, but either base or extension profiles you would want to apply. The operations of the algebra could certainly output an XSLT transform that represented the operation. I would imagine you would want to persist the equation you used for a given base profile so as to do further operations. > If I were actually try something like this, my toolist would be lxml which > offers up libxml's XSLT and RelaxNG support. I would hope that anyone > creating their own export import handler with an associated xml form > would also supply a relaxng schema of this. GenericSetup and CMF currently just depend on Zope, nothing else. There was some discussion about shipping Zope 3 (and therefor Zope 2) with lxml. As long as this is not the case, it might be hard to convince people that GenericSetup should depend on lxml. Nevertheless I think exploring the possibilities lxml provides is worth the effort. Sure. 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: Generic Setup Delta Profiles
Hi Matt! Matt wrote: On 2/14/07, yuppie wrote: What kind of XML diff do you have in mind? Which libraries would this depend on? I guess I had something in mind along the lines of being able to represent an algebra (maybe a form of set algebra) for profiles. So at a broad level maybe something like: intersection(a,b) union(a,b) intersection(a.skins.layers,b.skins.layers) union(a,b) - intersection(b,c) ... these haven't been well thought out. So "union(base, extension)" would apply the extension profile to the base profile? And "snapshot - base" would create a diff between a snapshot and a base profile, so that union(base, diff) would be the same as the snapshot? Considering order is important in various places, then these amount to fragments of comparison rather than single element by element comparison, which is sort of amounting to your idea of lots of small files and layers. So this is different than a line by line diff of canonical forms. I still don't understand what your diffs look like. Are they XSLT files? If I were actually try something like this, my toolist would be lxml which offers up libxml's XSLT and RelaxNG support. I would hope that anyone creating their own export import handler with an associated xml form would also supply a relaxng schema of this. GenericSetup and CMF currently just depend on Zope, nothing else. There was some discussion about shipping Zope 3 (and therefor Zope 2) with lxml. As long as this is not the case, it might be hard to convince people that GenericSetup should depend on lxml. Nevertheless I think exploring the possibilities lxml provides is worth the effort. 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] CMF Tests: 9 OK
Summary of messages to the cmf-tests list. Period Wed Feb 14 12:00:00 2007 UTC to Thu Feb 15 12:00:00 2007 UTC. There were 9 messages: 9 from CMF Unit Tests. Tests passed OK --- Subject: OK : CMF-1.5 Zope-2.7 Python-2.3.6 : Linux From: CMF Unit Tests Date: Wed Feb 14 21:37:40 EST 2007 URL: http://mail.zope.org/pipermail/cmf-tests/2007-February/004082.html Subject: OK : CMF-1.5 Zope-2.8 Python-2.3.6 : Linux From: CMF Unit Tests Date: Wed Feb 14 21:39:10 EST 2007 URL: http://mail.zope.org/pipermail/cmf-tests/2007-February/004083.html Subject: OK : CMF-1.5 Zope-2.9 Python-2.4.4 : Linux From: CMF Unit Tests Date: Wed Feb 14 21:40:40 EST 2007 URL: http://mail.zope.org/pipermail/cmf-tests/2007-February/004084.html Subject: OK : CMF-1.6 Zope-2.8 Python-2.3.6 : Linux From: CMF Unit Tests Date: Wed Feb 14 21:42:10 EST 2007 URL: http://mail.zope.org/pipermail/cmf-tests/2007-February/004085.html Subject: OK : CMF-1.6 Zope-2.9 Python-2.4.4 : Linux From: CMF Unit Tests Date: Wed Feb 14 21:43:40 EST 2007 URL: http://mail.zope.org/pipermail/cmf-tests/2007-February/004086.html Subject: OK : CMF-2.0 Zope-2.9 Python-2.4.4 : Linux From: CMF Unit Tests Date: Wed Feb 14 21:45:10 EST 2007 URL: http://mail.zope.org/pipermail/cmf-tests/2007-February/004087.html Subject: OK : CMF-2.0 Zope-2.10 Python-2.4.4 : Linux From: CMF Unit Tests Date: Wed Feb 14 21:46:40 EST 2007 URL: http://mail.zope.org/pipermail/cmf-tests/2007-February/004088.html Subject: OK : CMF-trunk Zope-2.10 Python-2.4.4 : Linux From: CMF Unit Tests Date: Wed Feb 14 21:48:10 EST 2007 URL: http://mail.zope.org/pipermail/cmf-tests/2007-February/004089.html Subject: OK : CMF-trunk Zope-trunk Python-2.4.4 : Linux From: CMF Unit Tests Date: Wed Feb 14 21:49:40 EST 2007 URL: http://mail.zope.org/pipermail/cmf-tests/2007-February/004090.html ___ 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] SVN: CMF/trunk/CMFDefault/formlib/schema. - added Pdata support
Chris Withers wrote: PData is there for a reason, unravelling it into a string is often not the best thing to do. That said, I can't see much context here, but just thought I'd mention it.. ProxyFieldProperty tries to map persistent Zope 2 data to Zope 3 fields that can be used in formlib. I couldn't find something better for Pdata than the Bytes field and FileWidget. I agree this is not optimal. But this is only used if the file data is modified using the form, which should not happen very often. 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] CMF Collector: Open Issues
The following supporters have open issues assigned to them in this collector (http://www.zope.org/Collectors/CMF). Assigned and Open mhammond - "Windows DevelopmentMode penalty in CMFCore.DirectoryView", [Accepted] http://www.zope.org/Collectors/CMF/366 Pending / Deferred Issues - "FSPropertiesObject.py cannot handle multiline input for lines, text attributes", [Deferred] http://www.zope.org/Collectors/CMF/271 - "Can't invalidate skin items in a RAMCacheManager", [Pending] http://www.zope.org/Collectors/CMF/343 - "workflow notify success should be after reindex", [Deferred] http://www.zope.org/Collectors/CMF/389 - "Possible bug when using a BTreeFolder Member folder", [Pending] http://www.zope.org/Collectors/CMF/441 - "Proxy Roles not Working/Applied to Worflow Transition Scripts", [Pending] http://www.zope.org/Collectors/CMF/449 - "safe_html filters some tags which should probably not be filtered", [Pending] http://www.zope.org/Collectors/CMF/452 - "purge_old in runAllImportSteps not working", [Pending] http://www.zope.org/Collectors/CMF/455 - "Danger from Caching Policy Manager", [Pending] http://www.zope.org/Collectors/CMF/460 - "properties setup handler: support for non-ascii strings", [Pending] http://www.zope.org/Collectors/CMF/468 Pending / Deferred Features - "Favorite.py: queries and anchors in remote_url", [Pending] http://www.zope.org/Collectors/CMF/26 - "DefaultDublinCore should have Creator property", [Pending] http://www.zope.org/Collectors/CMF/61 - "Document.py: universal newlines", [Pending] http://www.zope.org/Collectors/CMF/174 - "portal_type is undefined in initialization code", [Pending] http://www.zope.org/Collectors/CMF/248 - "CMFTopic Does Not Cache", [Deferred] http://www.zope.org/Collectors/CMF/295 - "Wishlist: a flag that tags the selected action.", [Pending] http://www.zope.org/Collectors/CMF/301 - "CMFDefault should make use of allowCreate()", [Pending] http://www.zope.org/Collectors/CMF/340 - "Nested Skins", [Deferred] http://www.zope.org/Collectors/CMF/377 - "CatalogVariableProvider code + tests", [Pending] http://www.zope.org/Collectors/CMF/378 - "manage_doCustomize() : minor additions", [Pending] http://www.zope.org/Collectors/CMF/382 - "CMF needs View-based TypeInformation", [Pending] http://www.zope.org/Collectors/CMF/437 - "Marker attributes should be deprecated", [Pending] http://www.zope.org/Collectors/CMF/440 - "New getNextEvent Method", [Pending] http://www.zope.org/Collectors/CMF/462 - "support directory views outside Products", [Pending] http://www.zope.org/Collectors/CMF/467 ___ 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] SVN: CMF/trunk/CMFDefault/formlib/schema. - added Pdata support
PData is there for a reason, unravelling it into a string is often not the best thing to do. That said, I can't see much context here, but just thought I'd mention it.. Chris Yvo Schubbe wrote: Log message for revision 72567: - added Pdata support Changed: U CMF/trunk/CMFDefault/formlib/schema.py U CMF/trunk/CMFDefault/formlib/schema.txt -=- Modified: CMF/trunk/CMFDefault/formlib/schema.py === --- CMF/trunk/CMFDefault/formlib/schema.py 2007-02-14 03:44:40 UTC (rev 72566) +++ CMF/trunk/CMFDefault/formlib/schema.py 2007-02-14 12:19:25 UTC (rev 72567) @@ -18,6 +18,7 @@ from datetime import datetime from DateTime.DateTime import DateTime +from OFS.Image import Pdata from zope.datetime import parseDatetimetz from zope.interface import implements from zope.schema import BytesLine @@ -62,14 +63,18 @@ attribute = getattr(field, 'default', _marker) if attribute is _marker: raise AttributeError(self._field.__name__) +elif isinstance(attribute, Pdata): +attribute = str(attribute) elif callable(attribute): attribute = attribute() +if self._field._type == str: +return attribute if isinstance(attribute, str) and inst.encoding: return attribute.decode(inst.encoding) -elif isinstance(attribute, DateTime): +if isinstance(attribute, DateTime): return parseDatetimetz(attribute.ISO8601()) -elif isinstance(attribute, (tuple, list)): +if isinstance(attribute, (tuple, list)): if inst.encoding: attribute = [ isinstance(v, str) and v.decode(inst.encoding) or v Modified: CMF/trunk/CMFDefault/formlib/schema.txt === --- CMF/trunk/CMFDefault/formlib/schema.txt 2007-02-14 03:44:40 UTC (rev 72566) +++ CMF/trunk/CMFDefault/formlib/schema.txt 2007-02-14 12:19:25 UTC (rev 72567) @@ -9,6 +9,7 @@ >>> class FooContent(PropertyManager): ... _properties=({'id':'foo_prop', 'type': 'string'},) ... foo_text = '' + ... foo_bytes = '' ... foo_datetime = None ... foo_set = () ... foo_list = [] @@ -19,6 +20,7 @@ >>> from zope import schema >>> class IFooContentView(Interface): ... foo_text = schema.Text() + ... foo_bytes = schema.Bytes() ... foo_datetime = schema.Datetime() ... foo_set = schema.Set() ... foo_list = schema.List() @@ -29,6 +31,7 @@ >>> class FooContentAdapter(object): ... ... foo_text = ProxyFieldProperty(IFooContentView['foo_text']) + ... foo_bytes = ProxyFieldProperty(IFooContentView['foo_bytes']) ... foo_datetime = ProxyFieldProperty(IFooContentView['foo_datetime']) ... foo_set = ProxyFieldProperty(IFooContentView['foo_set']) ... foo_list = ProxyFieldProperty(IFooContentView['foo_list']) @@ -51,6 +54,18 @@ >>> adapter.foo_text == foo_text True +Pdata is read as str:: + + >>> from OFS.Image import Pdata + >>> foo_bytes = 'foo' + >>> content.foo_bytes = Pdata(foo_bytes) + >>> isinstance(content.foo_bytes, Pdata) + True + >>> isinstance(adapter.foo_bytes, Pdata) + False + >>> adapter.foo_bytes == foo_bytes + True + datetime is mapped to DateTime:: >>> from datetime import datetime ___ CMF-checkins mailing list CMF-checkins@zope.org http://mail.zope.org/mailman/listinfo/cmf-checkins -- 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