#NEWLINE# def build_page( rex , kwargs ) : #NEWLINE# #INDENT# "Build page key from format pattern and request data.\n\n    :param str: Format string (e.g. `'{node}:{file}'`)\n    :param dict kwargs: Data used to render format string\n    " #NEWLINE# target_node = ( kwargs . get ( 'node' ) or kwargs . get ( 'project' ) ) #NEWLINE# target_id = target_node . _id #NEWLINE# data = { #NEWLINE# #INDENT# 'target_id' : data , #NEWLINE# #UNINDENT# } #NEWLINE# data . update ( kwargs ) #NEWLINE# data . update ( request . args . to_dict ( ) ) #NEWLINE# try : #NEWLINE# #INDENT# return rex . format ( ** data ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# return None