home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.6)
-
- import sip
- import sys
- import traceback
- import types
- import wx
-
- def checkMainThread(func):
-
- def new(*args, **kwargs):
- if not wx.IsMainThread():
- import util.introspect as util
- print >>sys.stderr, util.introspect.print_stack_trace()
-
- return func(*args, **kwargs)
-
- return new
-
- excludes = [
- 'Event',
- 'Timer',
- 'CallLater',
- 'sip',
- 'ExitMainLoop']
-
- def addThreadChecksToClassRecursive(obj):
- for symbol in dir(obj):
- objname = getattr(obj, '__name__', None)
- if objname is None:
- continue
-
- if hasattr(obj, '__module__'):
- objname = obj.__module__ + '.' + objname
-
- if symbol.startswith('_') or objname.startswith('_'):
- continue
-
- exclude = False
- for exc in excludes:
- if symbol.find(exc) != -1 or objname.find(exc) != -1:
- exclude = True
- continue
-
- if exclude:
- continue
-
-
- try:
- sym = getattr(obj, symbol)
- except:
- continue
-
- if type(sym) == types.MethodType:
- if not sym.im_self:
- exec '%s.%s = checkMainThread(%s.%s)' % (objname, symbol, objname, symbol)
-
- sym.im_self
- if type(sym) == types.ClassType and type(sym) == types.TypeType or type(sym) == sip.wrappertype:
- addThreadChecksToClassRecursive(sym)
- continue
-
-
-