def create_app(traceback_string, monitored_files=None): non_site_files = _filter_site_files(monitored_files) parsed_tb = _ParsedTB.from_string(traceback_string) resources = {'tb_str': traceback_string, 'parsed_error': parsed_tb, 'all_mon_files': monitored_files, 'mon_files': non_site_files} render_fact = AshesRenderFactory() render_fact.register_source('flaw_tmpl', _FLAW_TEMPLATE) routes = [('/', get_flaw_info, 'flaw_tmpl'), ('/<path:_ignored>', get_flaw_info, 'flaw_tmpl')] app = Application(routes, resources, render_fact) return app
def create_app(traceback_string, monitored_files=None): non_site_files = _filter_site_files(monitored_files) try: parsed_tb = _ParsedTB.from_string(traceback_string) parsed_error = parsed_tb.to_dict() except: parsed_error = {} resources = {'tb_str': traceback_string, 'parsed_error': parsed_error, 'all_mon_files': monitored_files, 'mon_files': non_site_files} render_fact = AshesRenderFactory() render_fact.register_source('flaw_tmpl', _FLAW_TEMPLATE) routes = [('/', get_flaw_info, 'flaw_tmpl'), ('/clastic_assets/', StaticApplication(_ASSET_PATH)), ('/<path:_ignored>', get_flaw_info, 'flaw_tmpl')] app = Application(routes, resources, render_fact) return app