# HG changeset patch # User paulb # Date 1132247388 0 # Node ID 5840277ad2943b12c4887fc4083bc8acaa73660f # Parent cbfeeba9fbe9c7bcf84310cb803bb8a1139441e8 [project @ 2005-11-17 17:09:48 by paulb] Added error handling for the situation where the Forms module has not been generated. diff -r cbfeeba9fbe9 -r 5840277ad294 examples/Common/QtConfigurator/__init__.py --- a/examples/Common/QtConfigurator/__init__.py Wed Nov 16 17:52:27 2005 +0000 +++ b/examples/Common/QtConfigurator/__init__.py Thu Nov 17 17:09:48 2005 +0000 @@ -186,7 +186,17 @@ if resource_type == "PyQt": import XSLForms.Resources.PyQtResources - import QtConfigurator.Forms + try: + import QtConfigurator.Forms + except ImportError: + print "*" * 60 + print "Please generate the following file before running this example:" + print os.path.join(os.path.split(__file__)[0], "Forms.py") + print "Use the pyuic program along with the form definition file:" + print os.path.join(os.path.split(__file__)[0], "Resources", "config.ui") + print "*" * 60 + print + raise class Configurator(ConfiguratorResource, QtConfigurator.Forms.Configurator, XSLForms.Resources.PyQtResources.XSLFormsResource): def __init__(self, *args, **kw): QtConfigurator.Forms.Configurator.__init__(self, *args, **kw)