-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
sbk-charts
executable file
·42 lines (36 loc) · 1.5 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
42
#!/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
import os
from charts.sheets import SbkMultiSheets
from charts.multicharts import SbkMultiCharts
from jproperties import Properties
SBK_BANNER_FILE = os.path.join(os.path.curdir, 'charts', 'banner.txt')
SBK_GRADLE_PROP_FILE = os.path.join(os.path.curdir, '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, separated 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()