<s> '''<STR_LIT>''' <EOL> __docformat__ = '<STR_LIT>' <EOL> __version__ = '<STR_LIT>' <EOL> import os <EOL> import sys <EOL> _is_epydoc = hasattr ( sys , '<STR_LIT>' ) and sys . is_epydoc <EOL> version = '<STR_LIT>' <EOL> def _require_ctypes_version ( version ) : <EOL> import ctypes <EOL> req = [ int ( i ) for i in version . split ( '<STR_LIT:.>' ) ] <EOL> have = [ int ( i ) for i in ctypes . __version__ . split ( '<STR_LIT:.>' ) ] <EOL> if not tuple ( have ) >= tuple ( req ) : <EOL> raise ImportError ( '<STR_LIT>' % version ) <EOL> _require_ctypes_version ( '<STR_LIT>' ) <EOL> _enable_optimisations = not __debug__ <EOL> if getattr ( sys , '<STR_LIT>' , None ) : <EOL> _enable_optimisations = True <EOL> options = { <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT:win32>' ) , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : not _enable_optimisations , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : <NUM_LIT:1> , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False , <EOL> } <EOL> _option_types = { <EOL> '<STR_LIT>' : tuple , <EOL> '<STR_LIT>' : tuple , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : int , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> '<STR_LIT>' : bool , <EOL> } <EOL> def _choose_darwin_platform ( ) : <EOL> """<STR_LIT>""" <EOL> if sys . platform != '<STR_LIT>' : <EOL> return <EOL> is_64bits = sys . maxint > <NUM_LIT:2> ** <NUM_LIT:32> <EOL> import platform <EOL> osx_version = platform . mac_ver ( ) [ <NUM_LIT:0> ] <EOL> from objc import __version__ as pyobjc_version <EOL> if is_64bits : <EOL> if osx_version < '<STR_LIT>' : <EOL> raise Exception ( '<STR_LIT>' ) <EOL> if pyobjc_version < '<STR_LIT>' : <EOL> raise Exception ( '<STR_LIT>' ) <EOL> options [ '<STR_LIT>' ] = True <EOL> else : <EOL> options [ '<STR_LIT>' ] = False <EOL> _choose_darwin_platform ( ) <EOL> def _read_environment ( ) : <EOL> '''<STR_LIT>''' <EOL> for key in options : <EOL> env = '<STR_LIT>' % key . upper ( ) <EOL> try : <EOL> value = os . environ [ env ] <EOL> if _option_types [ key ] is tuple : <EOL> options [ key ] = value . split ( '<STR_LIT:U+002C>' ) <EOL> elif _option_types [ key ] is bool : <EOL> options [ key ] = value in ( '<STR_LIT:true>' , '<STR_LIT>' , '<STR_LIT:True>' , '<STR_LIT:1>' ) <EOL> elif _option_types [ key ] is int : <EOL> options [ key ] = int ( value ) <EOL> except KeyError : <EOL> pass <EOL> _read_environment ( ) <EOL> if sys . platform == '<STR_LIT>' : <EOL> import ctypes <EOL> ctypes . windll = ctypes . cdll <EOL> ctypes . oledll = ctypes . cdll <EOL> ctypes . WINFUNCTYPE = ctypes . CFUNCTYPE <EOL> ctypes . HRESULT = ctypes . c_long <EOL> _trace_filename_abbreviations = { } <EOL> def _trace_repr ( value , size = <NUM_LIT> ) : <EOL> value = repr ( value ) <EOL> if len ( value ) > size : <EOL> value = value [ : size // <NUM_LIT:2> - <NUM_LIT:2> ] + '<STR_LIT>' + value [ - size // <NUM_LIT:2> - <NUM_LIT:1> : ] <EOL> return value <EOL> def _trace_frame ( thread , frame , indent ) : <EOL> from pyglet import lib <EOL> if frame . f_code is lib . _TraceFunction . __call__ . func_code : <EOL> is_ctypes = True <EOL> func = frame . f_locals [ '<STR_LIT>' ] . _func <EOL> name = func . __name__ <EOL> location = '<STR_LIT>' <EOL> else : <EOL> is_ctypes = False <EOL> code = frame . f_code <EOL> name = code . co_name <EOL> path = code . co_filename <EOL> line = code . co_firstlineno <EOL> try : <EOL> filename = _trace_filename_abbreviations [ path ] <EOL> except KeyError : <EOL> dir = '<STR_LIT>' <EOL> path , filename = os . path . split ( path ) <EOL> while len ( dir + filename ) < <NUM_LIT:30> : <EOL> filename = os . path . join ( dir , filename ) <EOL> path , dir = os . path . split ( path ) <EOL> if not dir : <EOL> filename = os . path . join ( '<STR_LIT>' , filename ) <EOL> break <EOL> else : <EOL> filename = os . path . join ( '<STR_LIT>' , filename ) <EOL> _trace_filename_abbreviations [ path ] = filename <EOL> location = '<STR_LIT>' % ( filename , line ) <EOL> if indent : <EOL> name = '<STR_LIT>' % name <EOL> print '<STR_LIT>' % ( thread , indent , name , location ) <EOL> if _trace_args : <EOL> if is_ctypes : <EOL> args = [ _trace_repr ( arg ) for arg in frame . f_locals [ '<STR_LIT:args>' ] ] <EOL> print '<STR_LIT>' % ( indent , '<STR_LIT:U+002CU+0020>' . join ( args ) ) <EOL> else : <EOL> for argname in code . co_varnames [ : code . co_argcount ] : <EOL> try : <EOL> argvalue = _trace_repr ( frame . f_locals [ argname ] ) <EOL> print '<STR_LIT>' % ( indent , argname , argvalue ) <EOL> except : <EOL> pass <EOL> if _trace_flush : <EOL> sys . stdout . flush ( ) <EOL> def _thread_trace_func ( thread ) : <EOL> def _trace_func ( frame , event , arg ) : <EOL> if event == '<STR_LIT>' : <EOL> indent = '<STR_LIT>' <EOL> for i in range ( _trace_depth ) : <EOL> _trace_frame ( thread , frame , indent ) <EOL> indent += '<STR_LIT:U+0020>' <EOL> frame = frame . f_back <EOL> if not frame : <EOL> break <EOL> elif event == '<STR_LIT>' : <EOL> ( exception , value , traceback ) = arg <EOL> print '<STR_LIT>' , repr ( exception ) <EOL> return _trace_func <EOL> def _install_trace ( ) : <EOL> global _trace_thread_count <EOL> sys . setprofile ( _thread_trace_func ( _trace_thread_count ) ) <EOL> _trace_thread_count += <NUM_LIT:1> <EOL> _trace_thread_count = <NUM_LIT:0> <EOL> _trace_args = options [ '<STR_LIT>' ] <EOL> _trace_depth = options [ '<STR_LIT>' ] <EOL> _trace_flush = options [ '<STR_LIT>' ] <EOL> if options [ '<STR_LIT>' ] : <EOL> _install_trace ( ) <EOL> class _ModuleProxy ( object ) : <EOL> _module = None <EOL> def __init__ ( self , name ) : <EOL> self . __dict__ [ '<STR_LIT>' ] = name <EOL> def __getattr__ ( self , name ) : <EOL> try : <EOL> return getattr ( self . _module , name ) <EOL> except AttributeError : <EOL> if self . _module is not None : <EOL> raise <EOL> import_name = '<STR_LIT>' % self . _module_name <EOL> __import__ ( import_name ) <EOL> module = sys . modules [ import_name ] <EOL> object . __setattr__ ( self , '<STR_LIT>' , module ) <EOL> globals ( ) [ self . _module_name ] = module <EOL> return getattr ( module , name ) <EOL> def __setattr__ ( self , name , value ) : <EOL> try : <EOL> setattr ( self . _module , name , value ) <EOL> except AttributeError : <EOL> if self . _module is not None : <EOL> raise <EOL> import_name = '<STR_LIT>' % self . _module_name <EOL> __import__ ( import_name ) <EOL> module = sys . modules [ import_name ] <EOL> object . __setattr__ ( self , '<STR_LIT>' , module ) <EOL> globals ( ) [ self . _module_name ] = module <EOL> setattr ( module , name , value ) <EOL> if not _is_epydoc : <EOL> app = _ModuleProxy ( '<STR_LIT>' ) <EOL> canvas = _ModuleProxy ( '<STR_LIT>' ) <EOL> clock = _ModuleProxy ( '<STR_LIT>' ) <EOL> com = _ModuleProxy ( '<STR_LIT>' ) <EOL> event = _ModuleProxy ( '<STR_LIT>' ) <EOL> font = _ModuleProxy ( '<STR_LIT>' ) <EOL> gl = _ModuleProxy ( '<STR_LIT>' ) <EOL> graphics = _ModuleProxy ( '<STR_LIT>' ) <EOL> image = _ModuleProxy ( '<STR_LIT:image>' ) <EOL> input = _ModuleProxy ( '<STR_LIT:input>' ) <EOL> lib = _ModuleProxy ( '<STR_LIT>' ) <EOL> media = _ModuleProxy ( '<STR_LIT>' ) <EOL> resource = _ModuleProxy ( '<STR_LIT>' ) <EOL> sprite = _ModuleProxy ( '<STR_LIT>' ) <EOL> text = _ModuleProxy ( '<STR_LIT:text>' ) <EOL> window = _ModuleProxy ( '<STR_LIT>' ) <EOL> if False : <EOL> import app <EOL> import canvas <EOL> import clock <EOL> import com <EOL> import event <EOL> import font <EOL> import gl <EOL> import graphics <EOL> import input <EOL> import image <EOL> import lib <EOL> import media <EOL> import resource <EOL> import sprite <EOL> import text <EOL> import window <EOL> if _is_epydoc : <EOL> import window </s>
