[Zope-Checkins] CVS: Zope3/lib/python/Zope/Event - metaConfigure.py:1.1.2.2

Jim Fulton jim@zope.com
Tue, 26 Mar 2002 19:46:47 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/Event
In directory cvs.zope.org:/tmp/cvs-serv28160/lib/python/Zope/Event

Modified Files:
      Tag: Zope-3x-branch
	metaConfigure.py 
Log Message:
Merged in changes from contextual-directives branch.

Now, a leading dot in a dotted name implies the package the include
file was included from. It still defaults to ZopeProducts if a file 
was not included via a package.

A few of the config files have been convered to use the
shorthand. The rest still can be converted.

I also checked this against Step 6 in the tutorial, which I will check
in in a moment.


=== Zope3/lib/python/Zope/Event/metaConfigure.py 1.1.2.1 => 1.1.2.2 ===
 
 from Zope.Configuration.Action import Action
-from Zope.Configuration.name import resolve
 
 from Zope.Event import subscribe as eventSubscribe
 
 counter = 0
 
-def subscribe(subscriber, event_types=None, filter=None):
+def subscribe(_context, subscriber, event_types=None, filter=None):
     global counter
     counter += 1
 
-    subscriber = resolve(subscriber)
+    subscriber = _context.resolve(subscriber)
 
     if event_types is None:
         event_types=(None,)
@@ -38,10 +37,10 @@
         for event_type_name in [element.strip()
                                 for element
                                 in event_type_names.split(',')]:
-            event_types.append(resolve(event_type_name))
+            event_types.append(_context.resolve(event_type_name))
                         
     if filter is not None:
-        filter = resolve(filter)
+        filter = _context.resolve(filter)
 
     return [
         Action(