def render_page(self, handler): handler.send_response(200) handler.send_header('Content-type','text/html') handler.end_headers() self.common_headers(handler.wfile) self.write(handler.wfile, "<body>\n") user_email = Auth.get_user_email(handler) self.menu_bar(handler.wfile) # If there's a report start time specified use that. Otherwise, # generate the report according to the current time. query_components = urllib.parse.parse_qs(urlparse(handler.path).query) if 'report_start' in query_components: report_start = datetime.datetime.strptime( query_components['report_start'][0], Constants.datetime_fmt) report_start = Config.meeting_timezone.localize(report_start) report = Util.report_from_start(report_start) else: now = datetime.datetime.now(pytz.utc) report = Util.report(now) self.write(handler.wfile, "Report for the current week:") self.get_acks(handler.wfile, report) self.render_eng_updates(handler.wfile) self.write(handler.wfile, "</body></html>\n")
def render_page(self, handler): handler.send_response(200) handler.send_header('Content-type', 'text/html') handler.end_headers() self.common_headers(handler.wfile) self.write( handler.wfile, """ <body> <form method=post action=/myacks accept-charset="UTF-8" id="action-form"> <input type="hidden" name="delete-id" id="delete-id"> <input type="hidden" name="delete-eng-update-id" id="delete-eng-update-id"> <input type="hidden" name="delete-bounty-id" id="delete-bounty-id"> <input type="hidden" name="close-bounty-id" id="close-bounty-id"> </form> """) user_email = Auth.get_user_email(handler) self.menu_bar(handler.wfile) # If there's a report start time specified use that. Otherwise, # generate the report according to the current time. query_components = urllib.parse.parse_qs(urlparse(handler.path).query) if 'report_start' in query_components: report_start = datetime.datetime.strptime( query_components['report_start'][0], Constants.datetime_fmt) report_start = Config.meeting_timezone.localize(report_start) report = Util.report_from_start(report_start) else: now = datetime.datetime.now(pytz.utc) report = Util.report(now) now = datetime.datetime.now(pytz.utc) self.report_header( handler.wfile, report, generate_links=True, msg="My acks for week:", ) self.get_my_acks(handler.wfile, user_email, report) self.render_my_eng_updates(handler.wfile, user_email, report) self.render_my_bounties(handler.wfile, user_email) self.write(handler.wfile, "</body></html>")