#NEWLINE# @ tornado . gen . coroutine #NEWLINE# def getprop( self , ctx , loctx , key ) : #NEWLINE# #INDENT# 'Get a realm-level property. This checks both the instance\n        and world tables.\n        ' #NEWLINE# wid = loctx . wid #NEWLINE# iid = loctx . iid #NEWLINE# app = ctx . app #NEWLINE# dependencies = ctx . dependencies #NEWLINE# if ( iid is not None ) : #NEWLINE# #INDENT# res = ( yield app . propcache . get ( ( 'instanceprop' , iid , None , key ) , dependencies = dependencies ) ) #NEWLINE# if res : #NEWLINE# #INDENT# return res . val #NEWLINE# #UNINDENT# #UNINDENT# if True : #NEWLINE# #INDENT# res = ( yield app . propcache . get ( ( 'worldprop' , wid , None , key ) , dependencies = dependencies ) ) #NEWLINE# if res : #NEWLINE# #INDENT# return res . val #NEWLINE# #UNINDENT# #UNINDENT# raise AttributeError ( ( 'Realm property "%s" is not found' % ( key , ) ) )