#NEWLINE# @ app . route ( '/view/video' , methods = ( 'GET' , 'POST' ) ) #NEWLINE# def view_video( ) : #NEWLINE# #INDENT# rsp = '<!doctype html><html><body>' #NEWLINE# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# add_video_from_post ( request . form ) #NEWLINE# rsp += 'Video added!<br>\n' #NEWLINE# #UNINDENT# rsp += "\n          <form name='formvideo' method='POST' target='_self'>\n            <fieldset><legend>Video Data</legend>\n            <table><tr>\n            <td><label for='name'>Name:&nbsp;</label></td>\n            <td><input type='text' name='name' id='name' size='64' maxlength='64' /></td>\n            </tr><tr>\n            <td><label for='url'>URL:&nbsp;</label></td>\n            <td><input type='text' name='url' id='url' size='64' maxlength='256' /></td>\n            </tr><tr>\n            <td><label for='duration'>Duration:&nbsp;</label></td>\n            <td><input type='text' name='duration' id='duration' size='16' maxlength='16' /></td>\n            </tr><tr>\n            <td style='text-align: right;' colspan=2><input type='submit' value='Add Video' /></td>\n            </tr></table></fieldset></form>" #NEWLINE# with video_lock : #NEWLINE# #INDENT# rsp += '\n' . join ( ( '{}: {}<br />' . format ( v . name , v . url ) for v in video_list ) ) #NEWLINE# #UNINDENT# return ( v + '</body></html>' )