[Zope-dev] [Checkins] SVN: z3c.form/branches/icemac_compatibility/ - Made compatible with `zope.app.publisher` 3.8.2
Adam GROSZER
agroszer at gmail.com
Fri Jul 17 12:55:25 EDT 2009
Hello Michael,
If possible please KEEP compatibility with KGS 3.4, it was a HUGE
fight to do it and I think most people don't want to live on the edge
of the trunk (yet).
Hint: there is
svn://svn.zope.org/repos/main/z3c.form/trunk/src/z3c/form/compatibility.py
There you can add compatibility code.
Friday, July 17, 2009, 6:44:08 PM, you wrote:
MH> Am 17.07.2009 um 18:24 schrieb Michael Howitz:
>> Log message for revision 101967:
>> - Made compatible with `zope.app.publisher` 3.8.2 (and above) by
>> using
>> the new absolute url adapter for resources introduced in 3.8.2.
MH> The current trunk of z3c.form is not compatible with
MH> zope.app.publisher 3.8.2 and above, as this version introduced an
MH> absolute url adapter for resources. This adapter does not exist in
MH> versions before 3.8.2. It returns a str instead of a unicode as
MH> Resource.__call__ did before. (Relying on this feature seems to be bad
MH> anyway.)
MH> So my question is whether z3c.form 2.x still has to be compatible with
MH> KGS 3.4 of if we can break this compatibility to get compatible with
MH> more recent versions of other packages.
MH> Trying to stay compatible requires at least some conditional code to
MH> register the new absolute url adapter in the tests.
MH> Is there any buildbot which tests z3c.form against KGS 3.4 and above?
>> - Fixed tests to run with `z3c.pt` 1.0b17 (and above) by adding a
>> missing test dependency on `zope.app.component`.
MH> This is necessary because zope.app.component no longer gets pulled in
MH> indirectly. But z3c.pt expects zope.app.component to be installed when
MH> zope.app.security is installed. (zope.app.security is a test
MH> dependency needed by browser/README.txt)
MH> zope.app.component is even required for one test (browser/README.txt)
MH> of z3c.form.
>> Changed:
>> U z3c.form/branches/icemac_compatibility/CHANGES.txt
>> U z3c.form/branches/icemac_compatibility/buildout.cfg
>> U z3c.form/branches/icemac_compatibility/setup.py
>> U z3c.form/branches/icemac_compatibility/src/z3c/form/browser/
>> README.txt
>> U z3c.form/branches/icemac_compatibility/src/z3c/form/browser/
>> image.py
>> U z3c.form/branches/icemac_compatibility/src/z3c/form/button.py
>> U z3c.form/branches/icemac_compatibility/src/z3c/form/button.txt
>>
>> -=-
>> Modified: z3c.form/branches/icemac_compatibility/CHANGES.txt
>> ===================================================================
>> --- z3c.form/branches/icemac_compatibility/CHANGES.txt 2009-07-17
>> 16:22:39 UTC (rev 101966)
>> +++ z3c.form/branches/icemac_compatibility/CHANGES.txt 2009-07-17
>> 16:24:27 UTC (rev 101967)
>> @@ -12,6 +12,13 @@
>> manager is only registered for dict, because it would otherwise get
>> picked up in undesired scenarios.
>>
>> +- Made compatible with `zope.app.publisher` 3.8.2 (and above) by
>> using
>> + the new absolute url adapter for resources introduced in 3.8.2.
>> +
>> +- Fixed tests to run with `z3c.pt` 1.0b17 (and above) by adding a
>> + missing test dependency on `zope.app.component`.
>> +
>> +
>> Version 2.0.0 (2009-06-14)
>> --------------------------
>>
>>
>> Modified: z3c.form/branches/icemac_compatibility/buildout.cfg
>> ===================================================================
>> --- z3c.form/branches/icemac_compatibility/buildout.cfg 2009-07-17
>> 16:22:39 UTC (rev 101966)
>> +++ z3c.form/branches/icemac_compatibility/buildout.cfg 2009-07-17
>> 16:24:27 UTC (rev 101967)
>> @@ -2,7 +2,12 @@
>> develop = . benchmark
>> parts = test test-no-z3cpt checker coverage-test coverage-report
>> docs i18n
>> benchmark python
>> +versions = versions
>>
>> +[versions]
>> +zope.app.publisher = 3.8.3
>> +z3c.pt = 1.0.0
>> +
>> [test-environment]
>> CHAMELEON_DEBUG = False
>> CHAMELEON_CACHE = False
>>
>> Modified: z3c.form/branches/icemac_compatibility/setup.py
>> ===================================================================
>> --- z3c.form/branches/icemac_compatibility/setup.py 2009-07-17
>> 16:22:39 UTC (rev 101966)
>> +++ z3c.form/branches/icemac_compatibility/setup.py 2009-07-17
>> 16:24:27 UTC (rev 101967)
>> @@ -91,6 +91,8 @@
>> 'zope.app.testing',
>> 'zope.container',
>> 'zope.testing',
>> + 'zope.app.component', # required by z3c.pt from 1.0b17 on
>> + # also required by our browser/
>> README.txt
>> ],
>> adding = ['zope.app.container'],
>> docs = ['z3c.recipe.sphinxdoc'],
>>
>> Modified: z3c.form/branches/icemac_compatibility/src/z3c/form/
>> browser/README.txt
>> ===================================================================
>> --- z3c.form/branches/icemac_compatibility/src/z3c/form/browser/
>> README.txt 2009-07-17 16:22:39 UTC (rev 101966)
>> +++ z3c.form/branches/icemac_compatibility/src/z3c/form/browser/
>> README.txt 2009-07-17 16:24:27 UTC (rev 101967)
>> @@ -500,6 +500,14 @@
>>>>> zope.component.provideAdapter(
>> ... resource, (None, None), ITraversable, name="resource")
>>
>> + # Register resource absolute url adapter
>> + >>> import zope.app.publisher.browser.resource
>> + >>> from zope.app.publisher.interfaces import IResource
>> + >>> import zope.traversing.browser.interfaces
>> + >>> zope.component.provideAdapter(
>> + ... zope.app.publisher.browser.resource.AbsoluteURL,
>> (IResource, None),
>> + ... zope.traversing.browser.interfaces.IAbsoluteURL)
>> +
>> # Register the "pressme.png" resource
>>>>> from zope.app.publisher.browser.resource import Resource
>>>>> testing.browserResource('pressme.png', Resource)
>>
>> Modified: z3c.form/branches/icemac_compatibility/src/z3c/form/
>> browser/image.py
>> ===================================================================
>> --- z3c.form/branches/icemac_compatibility/src/z3c/form/browser/
>> image.py 2009-07-17 16:22:39 UTC (rev 101966)
>> +++ z3c.form/branches/icemac_compatibility/src/z3c/form/browser/
>> image.py 2009-07-17 16:24:27 UTC (rev 101967)
>> @@ -51,6 +51,6 @@
>> image.value = field.title
>> # Get the full resource URL for the image:
>> site = hooks.getSite()
>> - image.src = zope.traversing.api.traverse(
>> - site, '++resource++' + field.image, request=request)()
>> + image.src = unicode(zope.traversing.api.traverse(
>> + site, '++resource++' + field.image, request=request)())
>> return image
>>
>> Modified: z3c.form/branches/icemac_compatibility/src/z3c/form/
>> button.py
>> ===================================================================
>> --- z3c.form/branches/icemac_compatibility/src/z3c/form/button.py
>> 2009-07-17 16:22:39 UTC (rev 101966)
>> +++ z3c.form/branches/icemac_compatibility/src/z3c/form/button.py
>> 2009-07-17 16:24:27 UTC (rev 101967)
>> @@ -234,8 +234,8 @@
>> @property
>> def src(self):
>> site = hooks.getSite()
>> - src = zope.traversing.api.traverse(
>> - site, '++resource++' + self.field.image,
>> request=self.request)()
>> + src = unicode(zope.traversing.api.traverse(
>> + site, '++resource++' + self.field.image,
>> request=self.request)())
>> return src
>>
>> def isExecuted(self):
>>
>> Modified: z3c.form/branches/icemac_compatibility/src/z3c/form/
>> button.txt
>> ===================================================================
>> --- z3c.form/branches/icemac_compatibility/src/z3c/form/button.txt
>> 2009-07-17 16:22:39 UTC (rev 101966)
>> +++ z3c.form/branches/icemac_compatibility/src/z3c/form/button.txt
>> 2009-07-17 16:24:27 UTC (rev 101967)
>> @@ -644,6 +644,14 @@
>>>>> zope.component.provideAdapter(
>> ... resource, (None, None), ITraversable, name="resource")
>>
>> + # Register resource absolute url adapter
>> + >>> import zope.app.publisher.browser.resource
>> + >>> from zope.app.publisher.interfaces import IResource
>> + >>> import zope.traversing.browser.interfaces
>> + >>> zope.component.provideAdapter(
>> + ... zope.app.publisher.browser.resource.AbsoluteURL,
>> (IResource, None),
>> + ... zope.traversing.browser.interfaces.IAbsoluteURL)
>> +
>> # Register the "submit.png" resource
>>>>> from zope.app.publisher.browser.resource import Resource
>>>>> testing.browserResource('submit.png', Resource)
MH> Yours sincerely,
--
Best regards,
Adam GROSZER mailto:agroszer at gmail.com
--
Quote of the day:
Faith is kept alive in us, and gathers strength, more from practice than from speculations.
- Joseph Addison
More information about the Zope-Dev
mailing list