bernhard@17: #!/usr/bin/env python3 bernhard@17: """Connect to roundup-tracker and save status to db for example demo2. bernhard@17: bernhard@17: Run periodically as often as you want data points to be saved. bernhard@17: demo2 tracks issue without priority in column `None`. bernhard@17: """ bernhard@17: from collect_issues import save_stats_in_db bernhard@17: import roundup_content_data as rcd bernhard@17: bernhard@17: BASE_URL_DEMO = "http://localhost:8917/demo/" bernhard@17: 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" bernhard@17: bernhard@17: LOGIN_PARAMETERS_DEMO = ( bernhard@17: ("__login_name", "demo"), bernhard@17: ("__login_password", "demo"), bernhard@17: ("@action", "Login"), bernhard@17: ) bernhard@17: bernhard@17: list_of_columns = ['critical', 'major', 'normal', 'minor', 'wishlist'] bernhard@17: data_dict = { key: [] for key in list_of_columns } bernhard@17: bernhard@17: # To track issues without prio we need to add an extra column in the db cmds. bernhard@17: select_all, select_where, create_db, insert_new = \ bernhard@17: rcd.build_sql_commands(list_of_columns + ['None']) bernhard@17: bernhard@17: # We enable the extra colum with `include_no_prio=True` bernhard@17: save_stats_in_db(LOGIN_PARAMETERS_DEMO, BASE_URL_DEMO, "./demo2.db", bernhard@17: list_of_columns, create_db, insert_new, bernhard@17: SEARCH_URL_DEMO, include_no_prio=True)