[Checkins] SVN: grok/branches/brandon-grokcore.component/src/grok/
Subscriber-related stuff moved to grokcore.component as well.
Philipp von Weitershausen
philikon at philikon.de
Thu May 1 04:36:00 EDT 2008
Log message for revision 85962:
Subscriber-related stuff moved to grokcore.component as well.
Changed:
U grok/branches/brandon-grokcore.component/src/grok/__init__.py
D grok/branches/brandon-grokcore.component/src/grok/decorators.py
U grok/branches/brandon-grokcore.component/src/grok/meta.py
-=-
Modified: grok/branches/brandon-grokcore.component/src/grok/__init__.py
===================================================================
--- grok/branches/brandon-grokcore.component/src/grok/__init__.py 2008-05-01 08:33:23 UTC (rev 85961)
+++ grok/branches/brandon-grokcore.component/src/grok/__init__.py 2008-05-01 08:35:59 UTC (rev 85962)
@@ -48,8 +48,7 @@
from grok.directive import (
template, templatedir, local_utility, permissions, require, site,
layer, viewletmanager, view)
-from grokcore.component.decorators import adapter, implementer
-from grok.decorators import subscribe
+from grokcore.component.decorators import subscribe, adapter, implementer
from martian.error import GrokError, GrokImportError
# BBB These two functions are meant for test fixtures and should be
Deleted: grok/branches/brandon-grokcore.component/src/grok/decorators.py
===================================================================
--- grok/branches/brandon-grokcore.component/src/grok/decorators.py 2008-05-01 08:33:23 UTC (rev 85961)
+++ grok/branches/brandon-grokcore.component/src/grok/decorators.py 2008-05-01 08:35:59 UTC (rev 85962)
@@ -1,39 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2006 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Grok
-"""
-import sys
-from martian.util import frame_is_module
-from martian.error import GrokImportError
-
-class subscribe:
-
- def __init__(self, *args):
- self.subscribed = args
-
- def __call__(self, function):
- frame = sys._getframe(1)
- if not frame_is_module(frame):
- raise GrokImportError("@grok.subscribe can only be used on module "
- "level.")
-
- if not self.subscribed:
- raise GrokImportError("@grok.subscribe requires at least one "
- "argument.")
-
- subscribers = frame.f_locals.get('__grok_subscribers__', None)
- if subscribers is None:
- frame.f_locals['__grok_subscribers__'] = subscribers = []
- subscribers.append((function, self.subscribed))
- return function
Modified: grok/branches/brandon-grokcore.component/src/grok/meta.py
===================================================================
--- grok/branches/brandon-grokcore.component/src/grok/meta.py 2008-05-01 08:33:23 UTC (rev 85961)
+++ grok/branches/brandon-grokcore.component/src/grok/meta.py 2008-05-01 08:35:59 UTC (rev 85962)
@@ -362,27 +362,6 @@
return True
-class SubscriberGrokker(martian.GlobalGrokker):
-
- def grok(self, name, module, module_info, config, **kw):
- subscribers = module_info.getAnnotation('grok.subscribers', [])
-
- for factory, subscribed in subscribers:
- config.action(
- discriminator=None,
- callable=component.provideHandler,
- args=(factory, subscribed),
- )
-
- for iface in subscribed:
- config.action(
- discriminator=None,
- callable=zope.component.interface.provideInterface,
- args=('', iface)
- )
- return True
-
-
class StaticResourcesGrokker(martian.GlobalGrokker):
def grok(self, name, module, module_info, config, **kw):
More information about the Checkins
mailing list