[Checkins] SVN: Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/ SavePoint
Christian Klinger
cklinger at novareto.de
Tue Oct 13 12:05:59 EDT 2009
Log message for revision 105050:
SavePoint
Changed:
U Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/components.py
U Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/directive.py
U Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/event.py
U Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/ftests/test_inclusion.py
U Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/meta.py
-=-
Modified: Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/components.py
===================================================================
--- Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/components.py 2009-10-13 15:43:19 UTC (rev 105049)
+++ Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/components.py 2009-10-13 16:05:59 UTC (rev 105050)
@@ -9,10 +9,9 @@
from zope.traversing.browser.interfaces import IAbsoluteURL
from hurry.zoperesource.zopesupport import getRequest
+
class Library(DirectoryResource):
-
- def __init__(self):
- pass
+ libs = []
@grok.adapter(Library)
Modified: Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/directive.py
===================================================================
--- Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/directive.py 2009-10-13 15:43:19 UTC (rev 105049)
+++ Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/directive.py 2009-10-13 16:05:59 UTC (rev 105050)
@@ -21,9 +21,14 @@
scope = martian.CLASS
store = martian.MULTIPLE
- def factory(self, value, name, bottom=False):
+ def factory(self, value, name):
return (value, name)
class bottom(martian.MarkerDirective):
store = martian.ONCE
scope = martian.CLASS
+
+
+class includeall(martian.Directive):
+ store = martian.ONCE
+ scope = martian.CLASS
Modified: Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/event.py
===================================================================
--- Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/event.py 2009-10-13 15:43:19 UTC (rev 105049)
+++ Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/event.py 2009-10-13 16:05:59 UTC (rev 105050)
@@ -3,17 +3,20 @@
from zope.app.publication.interfaces import IBeforeTraverseEvent
from zope.security.proxy import removeSecurityProxy
-from megrok.resource import include, bottom
+from megrok.resource import include, bottom, includeall
@grok.subscribe(grok.View, IBeforeTraverseEvent)
def handle(view, event):
view = removeSecurityProxy(view)
+ all = includeall.bind().get(view)
includes = include.bind().get(view)
+ #import pdb; pdb.set_trace()
+ if all:
+ for name in all.libs:
+
for lib, name in includes:
inn = getattr(lib, name)
inn.need()
- bot = False
- bot = bottom.bind().get(view)
- if bot:
-
+ bottom = bottom.bind().get(view)
+ if botom:
hurry.resource.bottom()
Modified: Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/ftests/test_inclusion.py
===================================================================
--- Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/ftests/test_inclusion.py 2009-10-13 15:43:19 UTC (rev 105049)
+++ Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/ftests/test_inclusion.py 2009-10-13 16:05:59 UTC (rev 105050)
@@ -64,7 +64,7 @@
import grok
from zope.interface import Interface
-from megrok.resource import Library, include, inclusion, bottom
+from megrok.resource import Library, include, inclusion, bottom, includeall
from hurry.resource import ResourceInclusion
@@ -94,7 +94,7 @@
class All(grok.View):
grok.context(Interface)
template = grok.PageTemplateFile('templates/myview.pt')
- include(Styles)
+ includeall(Styles)
Modified: Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/meta.py
===================================================================
--- Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/meta.py 2009-10-13 15:43:19 UTC (rev 105049)
+++ Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/meta.py 2009-10-13 16:05:59 UTC (rev 105050)
@@ -23,4 +23,5 @@
for name, file, depends, bottom in inclusion:
RI = ResourceInclusion(class_, file, depends=depends, bottom=bottom)
setattr(class_, name, RI)
+ class_.libs.append(name)
return True
More information about the checkins
mailing list