Changeset 7941:2e7ca228441e in orange


Ignore:
Timestamp:
05/25/11 12:31:56 (3 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
b2d72d387d583008d2f6811ca206e85db6821da6
Message:

Removed unused function thread_safe_discard.
Bug fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeCanvas/orngOutput.py

    r7066 r7941  
    1616except NameError: 
    1717    __DISABLE_OUTPUT__ = False 
    18      
    19 def thread_safe_discard(func): 
    20     """  
    21     """ 
    22     from functools import wraps 
    23     @wraps(func) 
    24     def safe_wrapper(self, *args, **kwargs): 
    25         if not hasattr(self, "_thread_safe_thread"): 
    26             self._thread_safe_thread = self.thread() 
    27         if QThread.currentThread() is not self._thread_safe_thread: 
    28             print >> sys.stderr, "Calling", func, "from the wrong thread.", "Discarding the call!" 
    29         else: 
    30             return func(self, *args, **kwargs) 
    31     return safe_wrapper 
    3218 
    3319def thread_safe_queue(func): 
     
    3723    @wraps(func) 
    3824    def safe_wrapper(self, *args, **kwargs): 
    39         if not hasattr(self, "_thread_safe_queue"): 
     25        if not hasattr(self, "_thread_safe_thread"):  
    4026            self._thread_safe_thread = self.thread() 
    4127        if QThread.currentThread() is not self._thread_safe_thread: 
    42             print >> sys.stderr, "Calling", func, "from the wrong thread.", "Queuing the call!" 
     28            print >> sys.stderr, "Calling", func, "with", args, kwargs, "from the wrong thread.", "Queuing the call!" 
    4329            QMetaObject.invokeMethod(self, "queuedInvoke", Qt.QueuedConnection, Q_ARG("PyQt_PyObject", partial(safe_wrapper, self, *args, **kwargs))) 
    4430        else: 
     
    194180        for i in range(len(list)): 
    195181            (file, line, funct, code) = list[i] 
    196             if code == None: continue 
     182            if code == None: 
     183                continue 
    197184            (dir, filename) = os.path.split(file) 
    198185            text += "<nobr>" + totalSpace + "File: <b>" + filename + "</b>, line %4d" %(line) + " in <b>%s</b></nobr><br>\n" % (self.getSafeString(funct)) 
Note: See TracChangeset for help on using the changeset viewer.