Changeset 9602:ca787805af6e in orange


Ignore:
Timestamp:
01/30/12 13:20:26 (2 years ago)
Author:
ales_erjavec
Branch:
default
rebase_source:
852c541d95419e49b7b24daad8adb333bec6a6b3
Message:

Added parentContext parameter to initLocalContext

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/OWContexts.py

    r8042 r9602  
    4141        return context 
    4242 
    43     def initLocalContext(self, widget): 
     43    def initLocalContext(self, widget, parentContext=None): 
    4444        if not hasattr(widget, self.localContextName): 
     45            if parentContext is None: 
     46                globalContexts = self.globalContexts 
     47            else: 
     48                # parentContext is a Schema level context repo  
     49                globalContexts = parentContext.globalContexts 
     50                 
    4551            if self.syncWithGlobal: 
    46                 setattr(widget, self.localContextName, self.globalContexts) 
    47             else: 
    48                 setattr(widget, self.localContextName, copy.deepcopy(self.globalContexts)) 
     52                setattr(widget, self.localContextName, globalContexts) 
     53            else: 
     54                setattr(widget, self.localContextName, copy.deepcopy(globalContexts)) 
    4955         
    5056    def findOrCreateContext(self, widget, *arg, **argkw):         
Note: See TracChangeset for help on using the changeset viewer.