[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser - AddConnectionConfiguration.py:1.4

Steve Alexander steve@cat-box.net
Sat, 21 Dec 2002 15:00:41 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv9845/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser

Modified Files:
	AddConnectionConfiguration.py 
Log Message:
Made the component_path give a reasonable error when you don't give
a component_path. 

Actually, this should be refactored in line with the adapters service,
to be a self-posting form, and use the schema for validation.


=== Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/AddConnectionConfiguration.py 1.3 => 1.4 ===
--- Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/AddConnectionConfiguration.py:1.3	Thu Dec 12 06:32:31 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/ConnectionService/Views/Browser/AddConnectionConfiguration.py	Sat Dec 21 15:00:40 2002
@@ -39,9 +39,11 @@
         paths.sort()
         return paths
 
-    def action(self, connection_name, component_path):
+    def action(self, connection_name, component_path=None):
         if not connection_name:
-            raise ValueError, 'You must specify a connection name'
+            raise ValueError('You must specify a connection name')
+        if not component_path:
+            raise ValueError('You must specify a component path')
         cd = ConnectionConfiguration(connection_name, component_path)
         cd = self.context.add(cd)
         getWidgetsDataForContent(self, IConnectionConfiguration, content=cd)