Mercurial > roundup-cc
comparison roundup_cc.py @ 31:9aca070c86bd
Add the filter 'priority' for the search by status.
author | Magnus Schieder <mschieder@intevation.de> |
---|---|
date | Thu, 22 Nov 2018 19:34:53 +0100 |
parents | e2864dabdb8c |
children | 80bbd06fe8ec |
comparison
equal
deleted
inserted
replaced
30:0d6504d02a6b | 31:9aca070c86bd |
---|---|
34 ) | 34 ) |
35 | 35 |
36 database_file = config.get("DB", "DatabaseFile") | 36 database_file = config.get("DB", "DatabaseFile") |
37 | 37 |
38 keywords = config.get("SEARCH", "Keywords", fallback="").split(", ") | 38 keywords = config.get("SEARCH", "Keywords", fallback="").split(", ") |
39 include_no_prio = config.getboolean("SEARCH", "IncludeNoPrio", fallback= False) | |
39 | 40 |
40 search = config.get("SEARCH", "Search", fallback="prio") | 41 search = config.get("SEARCH", "Search", fallback="prio") |
41 if search == "prio": | 42 if search == "prio": |
42 list_of_columns = config.get("SEARCH", "Priority", fallback=PRIO).split(", ") | 43 list_of_columns = config.get("SEARCH", "Priority", fallback=PRIO).split(", ") |
43 status = config.get("SEARCH", "Status", fallback="").split(", ") | 44 search_parameters = config.get("SEARCH", "Status", fallback="").split(", ") |
44 include_no_prio = config.getboolean("SEARCH", "IncludeNoPrio", fallback= False) | |
45 if include_no_prio: | 45 if include_no_prio: |
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 # statsu = columns Must change |
51 include_no_prio = False | 51 search_parameters = config.get("SEARCH", "Priority", fallback="").split(", ") |
52 if include_no_prio: | |
53 search_parameters += ["None"] | |
54 | |
52 | 55 |
53 else: | 56 else: |
54 print("Incorrect [SEARCH]Search parameter. (prio, status)") | 57 print("Incorrect [SEARCH]Search parameter. (prio, status)") |
55 return | 58 return |
56 | 59 |
61 | 64 |
62 select_all, select_where, create_db, insert_new = \ | 65 select_all, select_where, create_db, insert_new = \ |
63 rcd.build_sql_commands(sql_list_of_columns) | 66 rcd.build_sql_commands(sql_list_of_columns) |
64 | 67 |
65 save_stats_in_db(search, login_parameters, base_url, database_file, | 68 save_stats_in_db(search, login_parameters, base_url, database_file, |
66 list_of_columns, create_db, insert_new, keywords, status, include_no_prio) | 69 list_of_columns, create_db, insert_new, keywords, search_parameters, include_no_prio) |
67 | 70 |
68 if __name__ == '__main__': | 71 if __name__ == '__main__': |
69 main() | 72 main() |