quixote/form form.ptl,1.4,1.5

Neil Schemenauer <nascheme-fVcApmY9cLvQ3/1i3zOLAti2O/[email protected]>
Newsgroups gmane.comp.web.quixote.cvs
Message-ID <[email protected]>
Update of /home/cvs/quixote/form
In directory hewson:/tmp/cvs-serv1672

Modified Files:
	form.ptl 
Log Message:
Raise a nicer error message if the widget_type is a string and is not a
registered name.


Index: form.ptl
===================================================================
RCS file: /home/cvs/quixote/form/form.ptl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- form.ptl	29 Oct 2002 16:44:02 -0000	1.4
+++ form.ptl	1 Nov 2002 20:56:21 -0000	1.5
@@ -491,4 +491,7 @@
 
 def get_widget_class (widget_type):
     global _widget_class
-    return _widget_class.get(widget_type, widget_type)
+    klass = _widget_class.get(widget_type, widget_type)
+    if not callable(klass):
+        raise TypeError, 'widget_type %r is not callable' % widget_type
+    return klass
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.