本文整理汇总了Python中vizgrimoire.report.Report.init方法的典型用法代码示例。如果您正苦于以下问题:Python Report.init方法的具体用法?Python Report.init怎么用?Python Report.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vizgrimoire.report.Report
的用法示例。
在下文中一共展示了Report.init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init_env
# 需要导入模块: from vizgrimoire.report import Report [as 别名]
# 或者: from vizgrimoire.report.Report import init [as 别名]
def init_env():
# env vars for R
os.environ["LANG"] = ""
os.environ["R_LIBS"] = "../../r-lib"
if __name__ == '__main__':
init_env()
from vizgrimoire.GrimoireUtils import getPeriod, read_main_conf, createJSON
from vizgrimoire.report import Report
logging.basicConfig(level=logging.INFO,format='%(asctime)s %(message)s')
logging.info("Starting Report analysis")
opts = read_options()
Report.init(opts.config_file, opts.metrics_path)
automator = read_main_conf(opts.config_file)
if 'start_date' not in automator['r']:
logging.error("start_date (yyyy-mm-dd) not found in " + opts.config_file)
sys.exit()
start_date = automator['r']['start_date']
if 'end_date' not in automator['r']:
end_date = time.strftime('%Y-%m-%d')
else:
end_date = automator['r']['end_date']
if 'period' not in automator['r']:
period = getPeriod("months")
else:
period = getPeriod(automator['r']['period'])
示例2: init_env
# 需要导入模块: from vizgrimoire.report import Report [as 别名]
# 或者: from vizgrimoire.report.Report import init [as 别名]
# env vars for R
os.environ["LANG"] = ""
os.environ["R_LIBS"] = "../../r-lib"
if __name__ == '__main__':
init_env()
from vizgrimoire.metrics.metric import Metric
from vizgrimoire.SCM import SCM
from vizgrimoire.report import Report
logging.basicConfig(level=logging.INFO,format='%(asctime)s %(message)s')
logging.info("Grimoire Metrics Tool")
opts = get_options()
Report.init(opts.automator_file, opts.metrics_path)
# metrics = SCM.get_metrics_definition()
# for name in metrics:
# print name
dss = Report.get_data_sources()
if (opts.data_source):
ds = Report.get_data_source(opts.data_source)
dss = [ds]
if ds is None:
logging.error("Data source not found " + opts.data_source)
dss = []
total_metrics = 0