forked from kmgowda/SBK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sbk-charts
executable file
·41 lines (35 loc) · 1.43 KB
/
sbk-charts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/local/bin/python3
# Copyright (c) KMG. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
##
import argparse
from charts.sheets import SbkMultiSheets
from charts.charts import SbkMultiCharts
from jproperties import Properties
SBK_BANNER_FILE = "./charts/banner.txt"
SBK_GRADLE_PROP_FILE = "./gradle.properties"
def sbk_charts():
parser = argparse.ArgumentParser(description='sbk charts',
epilog='Please report issues at https://github.com/kmgowda/SBK')
parser.add_argument('-i', '--ifiles', help="Input CSV files, seperated by ','", required=True)
parser.add_argument('-o', '--ofile', help='Output xlsx file', default="out.xlsx")
args = parser.parse_args()
configs = Properties()
with open(SBK_GRADLE_PROP_FILE, 'rb') as config_file:
configs.load(config_file)
sbk_version = configs.get('sbkVersion').data
print(open(SBK_BANNER_FILE, 'r').read())
print("Sbk Charts Version : " + sbk_version)
print('Input Files : ', args.ifiles)
print('Output File : ', args.ofile)
sh = SbkMultiSheets(args.ifiles.split(","), args.ofile)
sh.create_sheets()
ch = SbkMultiCharts(sbk_version, args.ofile)
ch.create_graphs()
if __name__ == "__main__":
sbk_charts()