home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 116
/
FreelogNo116-JuilletSeptembre2013.iso
/
GestionFichiers
/
metamorphose
/
metamorphose2_0.8.2_setup.exe
/
metamorphose2.exe
/
dummy_thread.pyo
(
.txt
)
< prev
next >
Wrap
Python Compiled Bytecode
|
2011-01-12
|
3KB
|
107 lines
# Source Generated with Decompyle++
# File: in.pyo (Python 2.6)
__all__ = [
'error',
'start_new_thread',
'exit',
'get_ident',
'allocate_lock',
'interrupt_main',
'LockType']
import traceback as _traceback
class error(Exception):
def __init__(self, *args):
self.args = args
def start_new_thread(function, args, kwargs = { }):
global _main, _interrupt
if type(args) != type(tuple()):
raise TypeError('2nd arg must be a tuple')
type(args) != type(tuple())
if type(kwargs) != type(dict()):
raise TypeError('3rd arg must be a dict')
type(kwargs) != type(dict())
_main = False
try:
function(*args, **kwargs)
except SystemExit:
pass
except:
_traceback.print_exc()
_main = True
if _interrupt:
_interrupt = False
raise KeyboardInterrupt
_interrupt
def exit():
raise SystemExit
def get_ident():
return -1
def allocate_lock():
return LockType()
def stack_size(size = None):
if size is not None:
raise error('setting thread stack size not supported')
size is not None
return 0
class LockType(object):
def __init__(self):
self.locked_status = False
def acquire(self, waitflag = None):
if waitflag is None or waitflag:
self.locked_status = True
return True
if not self.locked_status:
self.locked_status = True
return True
return False
__enter__ = acquire
def __exit__(self, typ, val, tb):
self.release()
def release(self):
if not self.locked_status:
raise error
self.locked_status
self.locked_status = False
return True
def locked(self):
return self.locked_status
_interrupt = False
_main = True
def interrupt_main():
global _interrupt
if _main:
raise KeyboardInterrupt
_main
_interrupt = True