[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/app/ Merged from trunk:

Jim Fulton jim at zope.com
Wed Aug 11 14:29:37 EDT 2004


Log message for revision 27015:
  Merged from trunk:
  
    r26960 | jim | 2004-08-09 11:59:34 -0400 (Mon, 09 Aug 2004) | 6 lines
  
  Removed the feature of calling methods during path traversal, as in:
  
    foo/somemethod/bar
  
  If you want to call a method during traversal, make it a property.
  
  


Changed:
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/onlinehelp/browser/__init__.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/onlinehelp/browser/contexthelp.pt
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/traversing/adapters.py


-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/onlinehelp/browser/__init__.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/onlinehelp/browser/__init__.py	2004-08-11 18:28:14 UTC (rev 27014)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/onlinehelp/browser/__init__.py	2004-08-11 18:29:37 UTC (rev 27015)
@@ -40,6 +40,8 @@
         self.treecontext = zapi.getUtility(IOnlineHelp,"OnlineHelp")
         return self.subtopics()
 
+    topicTree = property(getTopicTree)
+
     def listHelpItems(self):
         """ recurse through the help topic tree"""
         children=[]
@@ -136,3 +138,6 @@
             self.topic = onlinehelp
 
         return self.topic
+
+    contextHelpTopic = property(getContextHelpTopic)
+

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/onlinehelp/browser/contexthelp.pt
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/onlinehelp/browser/contexthelp.pt	2004-08-11 18:28:14 UTC (rev 27014)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/onlinehelp/browser/contexthelp.pt	2004-08-11 18:29:37 UTC (rev 27015)
@@ -1,7 +1,7 @@
 <html metal:use-macro="views/popup_macros/page">
 <head>
   <title metal:fill-slot="title" 
-      tal:content="view/getContextHelpTopic/title"
+      tal:content="view/contextHelpTopic/title"
       i18n:translate="">Title</title>
 </head>
 <body>
@@ -10,7 +10,7 @@
       <div class="box" id="help">
         <h4 i18n:translate="">Online Help - TOC</h4>              
         <div class="body">
-          <div tal:content="structure view/getTopicTree|nothing"
+          <div tal:content="structure view/topicTree|nothing"
                tal:omit-tag="">content of topicTree</div>
           <br />
         </div>
@@ -19,7 +19,7 @@
 
 <div metal:fill-slot="body">
 
-    <h1 tal:content="view/getContextHelpTopic/title"
+    <h1 tal:content="view/contextHelpTopic/title"
         i18n:translate="">Title of Help Topic</h1>
 
     <p tal:content="structure view/renderContextTopic"

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/traversing/adapters.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/traversing/adapters.py	2004-08-11 18:28:14 UTC (rev 27014)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/traversing/adapters.py	2004-08-11 18:29:37 UTC (rev 27015)
@@ -43,15 +43,6 @@
         __traceback_info__ = (subject, name, furtherPath)
         attr = getattr(subject, name, _marker)
         if attr is not _marker:
-            # TODO: It is pretty obvious that we should call methods.
-            #       That much is expected from page templates.
-            #       What about classmethods / staticmethods / other descriptors?
-            #       What about methods that take several arguments?
-            # We should probably use the inspect module here. The bit about
-            # methods taking arguments is tricky. Maybe it should just not be
-            # allowed.
-            if getattr(attr, '__class__', 0) == MethodType:
-                return attr()
             return attr
 
         if hasattr(subject, '__getitem__'):



More information about the Zope3-Checkins mailing list