Mercurial > roundup-cc
annotate collect_issues.py @ 9:e95f7bee8643
Really safe data.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Tue, 01 Dec 2015 09:13:32 +0100 |
parents | 3e9f4a6803d1 |
children | d0c439d1e833 |
rev | line source |
---|---|
1
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
1 #!/usr/bin/env python3 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
2 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
3 """ Fetch issues from a roundup-tracker and save them in a databse. |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
4 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
5 author: Sascha L. Teichmann <sascha.teichmann@intevation.de> |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
6 author: Bernhard Reiter <bernhard@intevation.de> |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
7 author: Sean Engelhardt <sean.engelhardt@intevation.de> |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
8 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
9 (c) 2010,2015 by Intevation GmbH |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
10 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
11 This is Free Software unter the terms of the |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
12 GNU GENERAL PUBLIC LICENSE Version 3 or later. |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
13 See http://www.gnu.org/licenses/gpl-3.0.txt for details |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
14 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
15 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
16 ##USAGE EXAMPLE: ## |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
17 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
18 BASE_URL_DEMO = "http://localhost:8917/demo/" |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
19 SEARCH_URL_DEMO = "issue?@action=export_csv&@columns=title,priority&@filter=status&@pagesize=50&@startwith=0&status=-1,1,2,3,4,5,6,7" |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
20 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
21 LOGIN_PARAMETERS_DEMO = ( |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
22 ("__login_name", "demo"), |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
23 ("__login_password", "demo"), |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
24 ("@action", "Login"), |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
25 ) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
26 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
27 save_stats_in_db(LOGIN_PARAMETERS_DEMO, BASE_URL_DEMO, rcd.DATABASE_DEMO, rcd.COLUMNS, rcd.CREATE_DB, rcd.INSERT_NEW, SEARCH_URL_DEMO) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
28 """ |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
29 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
30 import http.cookiejar |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
31 import urllib.parse |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
32 import urllib.request |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
33 import csv |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
34 import io |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
35 import sqlite3 as db |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
36 import os |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
37 import roundup_content_data as rcd |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
38 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
39 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
40 CHECK_ROUNDUP_ORDER = "priority?@action=export_csv&@columns=id,order" |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
41 CHECK_ROUNDUP_SEARCH_VALUES = "status?@action=export_csv&@columns=id&@filter=open&open=1" |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
42 SEARCH_ROUNDUP = "issue?@action=export_csv&@columns=priority&@filter=status&@pagesize=500&@startwith=0&status=-1,{search_values}" |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
43 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
44 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
45 def connect_to_server(params, baseurl): |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
46 enc_data = urllib.parse.urlencode(params).encode() |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
47 cj = http.cookiejar.CookieJar() |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
48 opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj)) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
49 req = urllib.request.Request(url=baseurl, data=enc_data) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
50 opener.open(req) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
51 return opener |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
52 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
53 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
54 def get_csv_from_server(opener, roundup_url, sub_url): |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
55 csv_req = urllib.request.Request(url=roundup_url+sub_url) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
56 f = opener.open(csv_req) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
57 csv_reader = csv.DictReader(io.TextIOWrapper(f)) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
58 return csv_reader |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
59 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
60 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
61 def set_search_paramters_on_URL(url, search_param_csv): |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
62 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
63 id_list = [] |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
64 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
65 for row in search_param_csv: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
66 id_list.append(row["id"]) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
67 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
68 new_url = url.format(search_values = ",".join(id_list)) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
69 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
70 return new_url |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
71 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
72 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
73 def check_create_database(database_file, sql_create_db): |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
74 if not os.path.isfile(database_file): |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
75 con = None |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
76 cur = None |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
77 try: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
78 con = db.connect(database_file) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
79 cur = con.cursor() |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
80 try: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
81 cur.execute(sql_create_db) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
82 con.commit() |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
83 os.chmod(database_file, 0o644) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
84 except: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
85 con.rollback() |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
86 raise |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
87 finally: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
88 if cur: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
89 cur.close() |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
90 if con: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
91 con.close() |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
92 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
93 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
94 def issues_to_quantities(issue_csv, columns, orders_csv): |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
95 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
96 quantities = [0] * len(columns) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
97 order_dict = {} |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
98 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
99 #convert the csv-dict reader to real dict |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
100 for row in orders_csv: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
101 order_dict[row["id"]] = int(float(row["order"])) # int(float()) because the order-value is indeed "1.0, 2.0" etc |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
102 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
103 for issue in issue_csv: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
104 priority = issue["priority"] |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
105 |
2 | 106 if priority.isdigit() == True : |
1
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
107 quantities[order_dict[priority] -1 ] += 1 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
108 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
109 # print("quantities : " + str(quantities)) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
110 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
111 return quantities |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
112 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
113 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
114 def save_issues_to_db(quantities, database_file, sql_create_db, sql_insert_in_db): |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
115 check_create_database(database_file, sql_create_db) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
116 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
117 cur = None |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
118 con = None |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
119 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
120 try: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
121 con = db.connect(database_file) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
122 cur = con.cursor() |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
123 try: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
124 cur.execute(sql_insert_in_db, quantities) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
125 con.commit() |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
126 except: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
127 con.rollback() |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
128 raise |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
129 finally: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
130 if cur: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
131 cur.close() |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
132 if con: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
133 con.close() |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
134 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
135 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
136 def save_stats_in_db(login_parmeters, baseurl, db_file, columns, sql_create_db, sql_insert_in_db, searchurl=False): |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
137 try: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
138 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
139 opener = connect_to_server(login_parmeters, baseurl) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
140 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
141 search_operators_csv = get_csv_from_server(opener, baseurl, CHECK_ROUNDUP_SEARCH_VALUES) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
142 order_csv = get_csv_from_server(opener, baseurl, CHECK_ROUNDUP_ORDER) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
143 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
144 if searchurl == False: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
145 formated_search_url = set_search_paramters_on_URL(SEARCH_ROUNDUP, search_operators_csv) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
146 else: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
147 formated_search_url = searchurl |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
148 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
149 current_issues_csv = get_csv_from_server(opener, baseurl, formated_search_url) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
150 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
151 opener.close() |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
152 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
153 quantities = issues_to_quantities(current_issues_csv, columns, order_csv) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
154 |
9 | 155 save_issues_to_db(quantities, db_file, sql_create_db, sql_insert_in_db) |
1
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
156 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
157 except urllib.error.URLError as e: |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
158 print("No Valid Connection to server : " + baseurl + "\nerror: " + str(e)) |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
159 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
160 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
161 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
162 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
163 |
2df45f6ecd81
new appereance (solid and dotted lines), resonsive layout, new legend,
sean
parents:
diff
changeset
|
164 |