Skip to content

Commit

Permalink
Change how the static resources are associated to a Layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
thefunny42 committed Apr 29, 2012
1 parent 4f5f542 commit 77b4cc6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Changelog
1.5 (unreleased)
----------------

- Nothing changed yet.

- Change how the static resources are associated to a ``Layout``,
using the new name ``__static_name__`` set by the template grokker.

1.4 (2011-07-13)
----------------
Expand Down
20 changes: 11 additions & 9 deletions src/grokcore/layout/components.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import os

from grokcore.layout.interfaces import IPage, ILayout
from zope.interface import Interface
from zope.publisher.publish import mapply

import grokcore.component as grok
import grokcore.formlib
import grokcore.view
import zope.component

from grokcore.layout.interfaces import IPage, ILayout
from zope.interface import Interface
import zope.errorview.browser
import zope.interface.common.interfaces
import zope.publisher.interfaces
import zope.security.interfaces
from zope.publisher.publish import mapply
import zope.interface.common.interfaces
import zope.errorview.browser


class Layout(grokcore.view.ViewSupport):
Expand All @@ -25,10 +25,12 @@ def __init__(self, request, context):
self.request = request
self.view = None

if getattr(self, 'module_info', None) is not None:
static_name = getattr(self, '__static_name__', None)
if static_name is not None:
self.static = zope.component.queryAdapter(
self.request, Interface,
name=self.module_info.package_dotted_name)
self.request,
Interface,
name=static_name)
else:
self.static = None

Expand Down

0 comments on commit 77b4cc6

Please sign in to comment.