Mercurial > roundup-cc
diff doc/collect_demo2.py @ 34:916fa83b4144
Clean up repository. 'Update README.creole'
* /doc added for the old demos.
* Added comments to config.ini.
author | Magnus Schieder <mschieder@intevation.de> |
---|---|
date | Mon, 26 Nov 2018 16:08:27 +0100 |
parents | examples/collect_demo2.py@adca5b3780d2 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/collect_demo2.py Mon Nov 26 16:08:27 2018 +0100 @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +"""Connect to roundup-tracker and save status to db for example demo2. + +Run periodically as often as you want data points to be saved. +demo2 tracks issue without priority in column `None`. +""" +from collect_issues import save_stats_in_db +import roundup_content_data as rcd + +BASE_URL_DEMO = "http://localhost:8917/demo/" +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" + +LOGIN_PARAMETERS_DEMO = ( + ("__login_name", "demo"), + ("__login_password", "demo"), + ("@action", "Login"), + ) + +list_of_columns = ['critical', 'major', 'normal', 'minor', 'wishlist'] +data_dict = { key: [] for key in list_of_columns } + +# To track issues without prio we need to add an extra column in the db cmds. +select_all, select_where, create_db, insert_new = \ + rcd.build_sql_commands(list_of_columns + ['None']) + +# We enable the extra colum with `include_no_prio=True` +save_stats_in_db(LOGIN_PARAMETERS_DEMO, BASE_URL_DEMO, "./demo2.db", + list_of_columns, create_db, insert_new, + SEARCH_URL_DEMO, include_no_prio=True)