[Zope3-checkins] CVS: Zope3/src/zope/app - configure.zcml:1.33 context.py:1.12 introspector.py:1.15

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Aug 15 21:45:07 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app
In directory cvs.zope.org:/tmp/cvs-serv20171/app

Modified Files:
	configure.zcml context.py introspector.py 
Log Message:
Merging dreamcatcher's TTW Schema branch:

1. Fixed Bug in adding that would cause infinite loops when the menu items
   action was not a valif view or factory id.

2. Extended adding to support more complex views. Until now we only 
   supported constructions like "+/AddView=id". Now you are able to say
   "+/AddView/More=id", which means that more information can be carried 
   in the URL. This can be used in many ways, including multi-page adding
   wizards. In my case I needed it to pass in the type of the TTW Schema-
   based Content Component.

3. Added Local Menus. This was a pain in the butt, but I think I got a 
   fairly nice model, where you can create local Menu Services, and Menus
   are simply named utilities. When active they are menus in the menu 
   service. This is very similar to the local interface service and TTW 
   Schema. 

4. Made some modifications to TTW Schema, cleaned up the code and moved
   the browser code and interfaces to the places they belong.

5. Added a Content Component Definition utility component, which takes a
   Schema and creates a content component for it, including permission
   settings and a menu entry. Currently the menu entry is always made to
   a local 'add_content' menu. I will change this and make it actually a
   screen, where the menu and title of the menu item can be chosen by the
   developer. Mmmh, should I add a factory for the definition as well, so
   that the content component is also available via python?

6. Added a Content Component Instance component that represents an 
   instance od a Content Component Definition. You will never directly 
   encounter this component, since it is automatically used by the adding
   code of the Content Component Definition.

7. Cleanups by both dreamcatcher and myself.

That's it. For more details see the branch checkin messages. I now consider
the dreamcatcher-ttwschema-branch closed.


=== Zope3/src/zope/app/configure.zcml 1.32 => 1.33 ===
--- Zope3/src/zope/app/configure.zcml:1.32	Thu Aug  7 17:34:18 2003
+++ Zope3/src/zope/app/configure.zcml	Fri Aug 15 20:42:30 2003
@@ -1,4 +1,4 @@
-<configure 
+<configure
     xmlns="http://namespaces.zope.org/zope"
     xmlns:global_translation="http://namespaces.zope.org/gts"
     i18n_domain="zope"
@@ -130,5 +130,7 @@
   <!-- Utilities -->
 
   <include package="zope.app.utilities" />
+  <include package="zope.app.schema" file="fieldforms.zcml" />
+
 
 </configure>


=== Zope3/src/zope/app/context.py 1.11 => 1.12 ===
--- Zope3/src/zope/app/context.py:1.11	Tue Jul  1 19:28:42 2003
+++ Zope3/src/zope/app/context.py	Fri Aug 15 20:42:30 2003
@@ -15,7 +15,6 @@
 
 Specifically, coordinate use of context wrappers and security proxies.
 
-Revision information:
 $Id$
 """
 
@@ -65,17 +64,17 @@
 
     Interfaces of X are ordered with the directly-provided interfaces first
 
-    >>> [interface.__name__ for interface in list(providedBy(x))]
+    >>> [interface.getName() for interface in list(providedBy(x))]
     ['I4', 'I3']
 
     When we decorate objects, what order should the interfaces come
     in?  One could argue that decorators are less specific, so they
     should come last.
 
-    >>> [interface.__name__ for interface in list(providedBy(D1(x)))]
+    >>> [interface.getName() for interface in list(providedBy(D1(x)))]
     ['I4', 'I3', 'I1']
 
-    >>> [interface.__name__ for interface in list(providedBy(D2(D1(x))))]
+    >>> [interface.getName() for interface in list(providedBy(D2(D1(x))))]
     ['I4', 'I3', 'I1', 'I2']
     """
     def __get__(self, inst, cls=None):


=== Zope3/src/zope/app/introspector.py 1.14 => 1.15 ===
--- Zope3/src/zope/app/introspector.py:1.14	Tue Aug 12 16:58:37 2003
+++ Zope3/src/zope/app/introspector.py	Fri Aug 15 20:42:31 2003
@@ -11,7 +11,10 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
+"""Introspector
 
+$Id$
+"""
 from zope.interface import Interface
 
 from zope.app.interfaces.introspector import IIntrospector
@@ -202,8 +205,10 @@
     ids = [id for id, iface in items
            if iface == interface]
     if not ids:
-        # Not every interface must be registered with the interface service;
-        # However the lookup should not fail, since this is just a name
-        return interface.__module__ + '.' + interface.__name__
+        # XXX Do not fail badly, instead resort to the standard
+        # way of getting the interface name, cause not all interfaces
+        # may be registered.
+        return interface.__module__ + '.' + interface.getName()
+
     assert len(ids) == 1, "Ambiguous interface names: %s" % ids
     return ids[0]




More information about the Zope3-Checkins mailing list