home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.5)
-
- from __future__ import with_statement
- import wx
- import pprint
- import traceback
- import sys
- from threading import currentThread
- from weakref import ref
- MAINTHREAD_NAME = 'MainThread'
-
- class ThreadsafeGUIProxy(object):
-
- def __init__(self, target):
- self.target = target
-
-
- def __getattr__(self, attr):
- method = getattr(self.target, attr)
-
-
- from traceback import print_exc
-
- def callevent(e):
- e.ref = None
-
- try:
- for callAfterCallback, a, k in e._callables:
-
- try:
- callAfterCallback(*a, **k)
- continue
- except Exception:
- e = None
- print_exc()
- continue
-
-
- except AttributeError:
- e.callable(*e.args, **e.kw)
-
-
- from wx import GetApp, NewEventType, PyEvent
-
- def CallAfterCombining(callable, *args, **kw):
- app = GetApp()
-
- try:
- r = app._last
- except AttributeError:
- pass
-
- e = r()
- if e is not None and e.ref is r:
- return e._callables.append((callable, args, kw))
-
-
- try:
- evt = PyEvent(0, app._CallAfterId)
- except AttributeError:
- id = app._CallAfterId = NewEventType()
- app.Connect(-1, -1, id, callevent)
- evt = PyEvent(0, id)
-
- evt._callables = [
- (callable, args, kw)]
- evt.ref = app._last = ref(evt)
- app.AddPendingEvent(evt)
-
-