Skip to content

Commit

Permalink
one more place to use zope.browserresource
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed May 21, 2012
1 parent 526573d commit 55f9cf7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/z3c/form/button.txt
Original file line number Diff line number Diff line change
Expand Up @@ -646,13 +646,11 @@ image must be available as a resource, so let's do that now:
... resource, (None, None), ITraversable, name="resource")

# New absolute URL adapter for resources, if available
>>> import zope.app.publisher.browser.resource
>>> if hasattr(zope.app.publisher.browser.resource, 'AbsoluteURL'):
... zope.component.provideAdapter(
... zope.app.publisher.browser.resource.AbsoluteURL)
>>> from zope.browserresource.resource import AbsoluteURL
>>> zope.component.provideAdapter(AbsoluteURL)

# Register the "submit.png" resource
>>> from zope.app.publisher.browser.resource import Resource
>>> from zope.browserresource.resource import Resource
>>> testing.browserResource('submit.png', Resource)

Now the attribute can be called:
Expand Down

0 comments on commit 55f9cf7

Please sign in to comment.