-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
executable file
·52 lines (41 loc) · 1.48 KB
/
main.py
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
43
44
45
46
47
48
49
50
51
52
# Imports
from data import Bugzilla
import sys
import plotly.plotly as py
import plotly.graph_objs as graph
import datetime
import time
from time import mktime
from datetime import date
# Config
config = {'username' : '[email protected]', 'password' : 'bugT3ster', 'uri' : 'https://landfill.bugzilla.org/bugzilla-5.0-branch'}
FROM_DATE = 1
TO_DATE = 2
DEFAULT_ARGS_LENGTH = 1
DATE_STR_FORMAT = "%Y%m%d"
# Some methods for test, at leat while I am developing the tool
bugzillaData = Bugzilla(config['username'], config['password'], config['uri'])
bugzillaData.setUp()
fromDate = None
toDate = None
try:
fromDateStr = sys.argv[FROM_DATE]
fromDate = datetime.datetime.strptime(fromDateStr, DATE_STR_FORMAT).date()
except IndexError:
fromDate = datetime.date(date.today().year, date.today().month, 01)
try:
toDateStr = sys.argv[TO_DATE]
toDate = datetime.datetime.strptime(toDateStr, DATE_STR_FORMAT).date()
except IndexError:
fromDate = datetime.date(date.today().year, date.today().month, date.today().day)
bugzillaData.extractData(fromDate, toDate)
# result.getOpenedBugs()
# result.getClosedBugs()
# data=report.viewBugsPerDay()
# plot_url = py.plot(data, filename='number-of-bugs-per-day')
#data = report.viewBugsPerComponent()
#layout = graph.Layout(barmode='group')
#fig = graph.Figure(data=data, layout=layout)
#plot_url = py.plot(data, filename='number-of-bugs-per-component-per-severity')
# data = result.viewBugsPerAssignee()
# plot_url = py.plot(data, filename='bugs-per-assignee')