Extended reports API

This commit is contained in:
Jeremy Stretch
2017-09-25 17:27:58 -04:00
parent 88c57d002d
commit d35a2b0faa
4 changed files with 107 additions and 17 deletions

View File

@@ -18,6 +18,14 @@ def is_report(obj):
return False
def get_report(module_name, report_name):
"""
Return a specific report from within a module.
"""
module = importlib.import_module('reports.{}'.format(module_name))
return getattr(module, report_name)
def get_reports():
"""
Compile a list of all reports available across all modules in the reports path. Returns a list of tuples: