diff examples/collect_demo3.py @ 21:7a523e13fcb3

Argpars added for the configuration file.
author Magnus Schieder <mschieder@intevation.de>
date Tue, 23 Oct 2018 13:06:16 +0200
parents 3bb3d9a9f1b7
children
line wrap: on
line diff
--- a/examples/collect_demo3.py	Mon Oct 22 16:49:58 2018 +0200
+++ b/examples/collect_demo3.py	Tue Oct 23 13:06:16 2018 +0200
@@ -7,13 +7,19 @@
 
 import json
 import configparser
+import argparse
+
 from collect_issues import save_stats_in_db
 import roundup_content_data as rcd
 
 COLUMNS = "critical, urgent, bug, feature, wish"
 
+parser = argparse.ArgumentParser()
+parser.add_argument("config_file", type=str, metavar="[config file]")
+args = parser.parse_args()
+
 config = configparser.ConfigParser()
-config.read('config3.ini')
+config.read(args.config_file)
 
 base_url = config.get("URL", "BaseURL")
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)