Mercurial > roundup-cc
comparison roundup_cc.py @ 28:e2864dabdb8c
fixes a logical error in the filtering of columns.
* The columns are stored in the pure order as they appear in the config.
* display_issues.py has been renamed to roundup_cc_display.py.
author | Magnus Schieder <mschieder@intevation.de> |
---|---|
date | Thu, 22 Nov 2018 12:57:20 +0100 |
parents | 761ee2351f58 |
children | 9aca070c86bd |
comparison
equal
deleted
inserted
replaced
27:cdab667c6abb | 28:e2864dabdb8c |
---|---|
9 | 9 |
10 from collect_issues import save_stats_in_db | 10 from collect_issues import save_stats_in_db |
11 import roundup_content_data as rcd | 11 import roundup_content_data as rcd |
12 | 12 |
13 PRIO = "critical, urgent, bug, feature, wish" | 13 PRIO = "critical, urgent, bug, feature, wish" |
14 STATES = "unread, deferred, chatting, need_eg, in_progress, testing, done_cbb, resolved" | 14 STATES = "unread, deferred, chatting, need-eg, in-progress, testing, done-cbb, resolved" |
15 | 15 |
16 def main(): | 16 def main(): |
17 | 17 |
18 parser = argparse.ArgumentParser() | 18 parser = argparse.ArgumentParser() |
19 parser.add_argument("config_file", type=str, metavar="[config file]") | 19 parser.add_argument("config_file", type=str, metavar="[config file]") |
46 list_of_columns += ["None"] | 46 list_of_columns += ["None"] |
47 | 47 |
48 elif search == "status": | 48 elif search == "status": |
49 list_of_columns = config.get("SEARCH", "Status", fallback=STATES).split(", ") | 49 list_of_columns = config.get("SEARCH", "Status", fallback=STATES).split(", ") |
50 status = [""] | 50 status = [""] |
51 include_no_prio = False | |
51 | 52 |
52 else: | 53 else: |
53 print("Incorrect [SEARCH]Search parameter. (prio, status)") | 54 print("Incorrect [SEARCH]Search parameter. (prio, status)") |
54 return | 55 return |
55 | 56 |
57 # roundup uses a "-" in its search parameters. Sql can't handle it. | |
58 sql_list_of_columns = [] | |
59 for column in list_of_columns: | |
60 sql_list_of_columns.append(column.replace("-", "_")) | |
61 | |
56 select_all, select_where, create_db, insert_new = \ | 62 select_all, select_where, create_db, insert_new = \ |
57 rcd.build_sql_commands(list_of_columns) | 63 rcd.build_sql_commands(sql_list_of_columns) |
58 | 64 |
59 save_stats_in_db(search, login_parameters, base_url, database_file, | 65 save_stats_in_db(search, login_parameters, base_url, database_file, |
60 list_of_columns, create_db, insert_new, keywords, status) | 66 list_of_columns, create_db, insert_new, keywords, status, include_no_prio) |
61 | 67 |
62 if __name__ == '__main__': | 68 if __name__ == '__main__': |
63 main() | 69 main() |