Ignore:
Timestamp:
04/20/12 03:15:24 (2 years ago)
Author:
mitar
Branch:
default
Message:

Support for widgets loading from modules, registered through entry point.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/orngCanvasItems.py

    r10732 r10827  
    272272    def __init__(self, signalManager, scene, view, widgetInfo, defaultPic, canvasDlg, widgetSettings = {}): 
    273273        # import widget class and create a class instance 
    274         m = __import__(widgetInfo.fileName) 
     274        if widgetInfo.module: 
     275            name = "%s.%s" % (widgetInfo.module, widgetInfo.fileName) 
     276            __import__(name) 
     277            m = sys.modules[name] 
     278        else: 
     279            m = __import__(widgetInfo.fileName) 
    275280        self.instance = m.__dict__[widgetInfo.fileName].__new__(m.__dict__[widgetInfo.fileName], _owInfo=canvasDlg.settings["owInfo"], 
    276281                                                                _owWarning = canvasDlg.settings["owWarning"], _owError=canvasDlg.settings["owError"], 
Note: See TracChangeset for help on using the changeset viewer.