#NEWLINE# def generate( random , pid , autogen_tools , n ) : #NEWLINE# #INDENT# '\n    Generate an instance of the problem\n    Needs to return a list of files to copy to particular instance.\n    ' #NEWLINE# generator_path = autogen_tools . get_directory ( __file__ ) #NEWLINE# template_path = path . join ( generator_path , 'website.html.template' ) #NEWLINE# rendered_template_path = path . join ( generator_path , 'website.html' ) #NEWLINE# key = 'my_key_here' #NEWLINE# flag = ( 'flag_' + sha1 ( ( str ( n ) + key ) . encode ( 'utf-8' ) ) . hexdigest ( ) ) #NEWLINE# autogen_tools . replace_source_tokens ( template_path , { #NEWLINE# #INDENT# 'flag' : flag , #NEWLINE# #UNINDENT# } , rendered_template_path ) #NEWLINE# homepage_link = autogen_tools . generate_resource_link ( pid , 'website.html' , title = 'odd website' ) #NEWLINE# return { #NEWLINE# #INDENT# 'resource_files' : { #NEWLINE# #INDENT# 'public' : [ ( rendered_template_path , 'website.html' ) ] , #NEWLINE# #UNINDENT# } , #NEWLINE# 'static_files' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'problem_updates' : { #NEWLINE# #INDENT# 'description' : ( 'Have you seen this %s? Maybe something is hidden there...' % homepage_link ) , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# }