#NEWLINE# def get_asset( asset , slug , userdata = None ) : #NEWLINE# #INDENT# game = get_game_by_slug ( slug ) #NEWLINE# if userdata : #NEWLINE# #INDENT# ( username , key ) = asset . split ( '/' , 1 ) #NEWLINE# user = get_user ( username ) #NEWLINE# userdata = UserData ( user = user , game = game ) #NEWLINE# json_asset = json . loads ( userdata . get ( key ) ) #NEWLINE# filename = ( key + '.txt' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# filename = get_absolute_path ( os . path . join ( game . path , asset ) ) #NEWLINE# with open ( filename , 'r' ) as handle : #NEWLINE# #INDENT# json_asset = json . load ( handle ) #NEWLINE# #UNINDENT# #UNINDENT# return ( handle , filename )