Hi,

 loadUI (below) is not working.

When I try MainForm(dabo.ui.dForm) ->

No module named dabo.ui.dForm.

- any thoughts on how to get it to work correctly with python 3.6?

def loadUI(uiType):
    """Load the given UI into the global namespace."""
    retVal = False
    currType = getUIType()
    mods = {"wx" : "dabo.ui.uiwx", "tk" : "dabo.ui.uitk"}
    if uiType.lower() in ("wx", "wxpython", "uiwx"):
        typ = "wx"
    elif uiType.lower() in ("tk", "tkinter", "uitk"):
        typ = "tk"
    else:
raise ValueError("Unknown UI type '%s' passed to loadUI()" % uiType)

    if currType is None:
        try:
            exec("from %s import *" % mods[typ], globals())
            retVal = True
        except Exception as e:
            retVal = False
            # Record the actual problem
            print(_("ui.loadUI failed: %s") % e)
            traceback.print_exc()
    else:
        if currType == typ:
            # No problem; just a redundant call
            pass
        else:
dabo.log.info(_("Cannot change the uiType to '%(typ)s', because UI '%(currType)s' is already loaded.")
                          % locals())
    return retVal


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to