#NEWLINE# def unjellyFromSource( stringOrFile ) : #NEWLINE# #INDENT# "\n    Pass me a string of code or a filename that defines an 'app' variable (in\n    terms of Abstract Objects!), and I'll execute it and unjelly the resulting\n    AOT for you, returning a newly unpersisted Application object!\n    " #NEWLINE# ns = { #NEWLINE# #INDENT# 'Instance' : Instance , #NEWLINE# 'InstanceMethod' : InstanceMethod , #NEWLINE# 'Class' : Class , #NEWLINE# 'Function' : Function , #NEWLINE# 'Module' : Module , #NEWLINE# 'Ref' : Ref , #NEWLINE# 'Deref' : Deref , #NEWLINE# 'Copyreg' : Copyreg , #NEWLINE# #UNINDENT# } #NEWLINE# if hasattr ( stringOrFile , 'read' ) : #NEWLINE# #INDENT# source = stringOrFile . read ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# source = stringOrFile #NEWLINE# #UNINDENT# code = compile ( source , '<source>' , 'exec' ) #NEWLINE# eval ( code , ns , ns ) #NEWLINE# if ( 'app' in ns ) : #NEWLINE# #INDENT# return unjellyFromAOT ( ns [ 'app' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( ( "%s needs to define an 'app', it didn't!" % stringOrFile ) )