#NEWLINE# @ tornado . gen . coroutine #NEWLINE# def execcode_expr_store( self , nod ) : #NEWLINE# #INDENT# 'Does not evaluate a complete expression. Instead, returns a\n        wrapper object with load(), store(), and delete() methods.\n        (The load() accessor supports augment "x += 1" operations.)\n        (The nod.ctx lets us know whether store/augment or delete is\n        coming up; but the way our proxies work, we don\'t much care.)\n        ' #NEWLINE# assert ( type ( nod . ctx ) is not ast . Load ) , 'target of assignment has Load context' #NEWLINE# nodtyp = type ( nod ) #NEWLINE# if ( nodtyp is ast . Name ) : #NEWLINE# #INDENT# return two . execute . BoundNameProxy ( nod . id ) #NEWLINE# #UNINDENT# if ( nodtyp is ast . Attribute ) : #NEWLINE# #INDENT# argument = ( yield self . execcode_expr ( nod . value ) ) #NEWLINE# key = nod . attr #NEWLINE# if isinstance ( argument , two . execute . PropertyProxyMixin ) : #NEWLINE# #INDENT# return two . execute . BoundPropertyProxy ( argument , key ) #NEWLINE# #UNINDENT# raise ExecSandboxException ( ( '%s.%s: setattr not allowed' % ( type ( argument ) . __name__ , key ) ) ) #NEWLINE# #UNINDENT# if ( nodtyp is ast . Subscript ) : #NEWLINE# #INDENT# argument = ( yield self . execcode_expr ( nod . value ) ) #NEWLINE# subnod = nod . slice #NEWLINE# subtyp = type ( subnod ) #NEWLINE# if ( subtyp is ast . Index ) : #NEWLINE# #INDENT# subscript = ( yield self . execcode_expr ( subnod . value ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( subtyp is ast . Slice ) : #NEWLINE# #INDENT# lower = None #NEWLINE# if ( subnod . lower is not None ) : #NEWLINE# #INDENT# lower = ( yield self . execcode_expr ( subnod . lower ) ) #NEWLINE# #UNINDENT# upper = None #NEWLINE# if ( subnod . upper is not None ) : #NEWLINE# #INDENT# upper = ( yield self . execcode_expr ( subnod . upper ) ) #NEWLINE# #UNINDENT# if ( subnod . step is None ) : #NEWLINE# #INDENT# subscript = slice ( lower , upper ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# step = ( yield self . execcode_expr ( subnod . step ) ) #NEWLINE# subscript = slice ( lower , upper , step ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise NotImplementedError ( ( 'Unsupported subscript type: %s' % ( subtyp . __name__ , ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# if isinstance ( argument , two . execute . PropertyProxyMixin ) : #NEWLINE# #INDENT# return two . execute . BoundPropertyProxy ( argument , subscript ) #NEWLINE# #UNINDENT# return two . execute . BoundSubscriptProxy ( argument , subscript ) #NEWLINE# #UNINDENT# if ( nodtyp in ( ast . Tuple , ast . List ) ) : #NEWLINE# #INDENT# ls = [ ] #NEWLINE# for subnod in nod . elts : #NEWLINE# #INDENT# val = ( yield self . execcode_expr_store ( subnod ) ) #NEWLINE# ls . append ( val ) #NEWLINE# #UNINDENT# return two . execute . MultiBoundProxy ( ls ) #NEWLINE# #UNINDENT# raise NotImplementedError ( ( 'Script store-expression type not implemented: %s' % ( nodtyp . __name__ , ) ) )