[Zope3-checkins] CVS: Zope3/utilities/fssync - add.py:1.4

Guido van Rossum guido@python.org
Tue, 6 May 2003 16:04:39 -0400


Update of /cvs-repository/Zope3/utilities/fssync
In directory cvs.zope.org:/tmp/cvs-serv28625

Modified Files:
	add.py 
Log Message:
One less ".xmlpickle".  Make addTypes output a little less exuberant.


=== Zope3/utilities/fssync/add.py 1.3 => 1.4 ===
--- Zope3/utilities/fssync/add.py:1.3	Mon May  5 17:17:58 2003
+++ Zope3/utilities/fssync/add.py	Tue May  6 16:04:38 2003
@@ -20,7 +20,7 @@
 from zope.app.interfaces.fssync import IObjectDirectory
 from zope.component import getView, queryView
 from zope.component.view import viewService
-from zope.xmlpickle.xmlpickle import loads
+from zope.xmlpickle import loads
 
 from common import getZODBPath, getApplicationRoot, getObject, getObjectAdapter
 
@@ -156,14 +156,11 @@
     adapter = getObjectAdapter(f)
     request = FSAddRequest()
     allviews = viewService.all()['default']
-    print
-    print "ALL AVAILABLE TYPES"
-    print "===================================================="
-    print
+    print "AVAILABLE TYPES"
+    print "==============="
     for view in allviews:
-        try:
-            if len(view)>1 and view[0] == '.':
-                doc = getView(adapter, view, request).__doc__
-                print ' %s  \n %s \n\n' % (view, doc)
-        except: # XXX which exception are we trying to catch?
-            pass
+        # The view named '.' is the default AddView object; skip it.
+        # Views whose name starts with '.' are our special add views.
+        if len(view) > 1 and view.startswith('.'):
+            doc = getView(adapter, view, request).__doc__
+            print ' %s  \n %s' % (view, doc)