Changeset 4005

Show
Ignore:
Timestamp:
03/30/08 07:58:34 (8 months ago)
Author:
ed
Message:

Fixed the error reporting code to handle exception types that can have or lack the various attributes that provide information about the exception.

Added code to read in connection information residing in the directories around a cdxml files when it is opened in the Class Designer. This will help enable you to run the Class Designer from one directory, and open designs in a completely different location without having to hard-code the full path to the .cnxml file in your design.

Thanks to Roger L for catching both of these!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ide/ClassDesigner.py

    r3983 r4005  
    630630        self._basePath = pth 
    631631        dabo.lib.utils.resolveAttributePathing(atts, pth) 
     632        # Read in any .cnxml connection defs. 
     633        currdir = os.path.dirname(pth) 
     634        self._initDB(currdir) 
     635        if os.path.split(currdir)[-1].lower() == "ui": 
     636            # Standard directory structure; process the parent directory 
     637            self._initDB(os.path.dirname(currdir)) 
    632638        if self._reuseMainForm(useSizers=atts.get("UseSizers", False)): 
    633639            # Original form hasn't changed, so just use it. 
     
    16731679            dabo.ui.stop(_("Attribute Error: %s") % e.message, _("Attribute Error")) 
    16741680        except StandardError, e: 
    1675             dabo.ui.stop(_("Compilation Error: %s\nCode: %s") % (e.msg, e.text.strip()), 
     1681            if hasattr(e, "message"): 
     1682                msg = e.message 
     1683            elif hasattr(e, "msg"): 
     1684                msg = e.msg 
     1685            else: 
     1686                msg = _("<unspecified>") 
     1687            if hasattr(e, "text"): 
     1688                txt = e.text.strip() 
     1689            else: 
     1690                txt = _("<unspecified>") 
     1691             
     1692            dabo.ui.stop(_("Compilation Error: %s\nCode: %s") % (msg, txt), 
    16761693                    _("Compilation Error")) 
    16771694