From ba6732e032b7ddd842476696e090c9140e961346 Mon Sep 17 00:00:00 2001 From: Alexander Vasarab Date: Tue, 30 Jun 2020 11:03:08 -0700 Subject: [PATCH] Change around and rename some config parameters --- .gitignore | 1 + README.md | 8 ++++---- config-nrcs.ini.example | 8 ++++---- infoex-autowx.py | 14 +++++++------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 0a764a4..6c5d96f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ env +.CSV diff --git a/README.md b/README.md index 4433828..fc9d6ae 100644 --- a/README.md +++ b/README.md @@ -62,16 +62,16 @@ values. The [ftp] values describe your credentials for the InfoEx automated weather station FTP server. -`[wxsite]` +`[nrcs]` `station_triplet = [The NRCS identifier for a particular SNOTEL site]` `desired_data = [A comma-delimited list of NRCS elements you're interested in]` -`location_uuid = [The UUID used by InfoEx to identify your automated Wx site]` -`csv_filename = [Arbitrary name of the file that will be uploaded to InfoEx]` -`[ftp]` +`[infoex]` `host = [InfoEx FTP host address]` `uuid = [InfoEx-supplied UUID]` `api_key = [InfoEx-supplied API Key]` +`csv_filename = [Arbitrary name of the file that will be uploaded to InfoEx]` +`location_uuid = [The UUID used by InfoEx to identify your automated Wx site]` Finding Your WXSITE values -------------------------- diff --git a/config-nrcs.ini.example b/config-nrcs.ini.example index 018a6fc..449132e 100644 --- a/config-nrcs.ini.example +++ b/config-nrcs.ini.example @@ -1,10 +1,10 @@ -[wxsite] +[nrcs] station_triplet = desired_data = -location_uuid = -csv_filename = -[ftp] +[infoex] host = uuid = api_key = +csv_filename = +location_uuid = diff --git a/infoex-autowx.py b/infoex-autowx.py index ea91bef..f703c42 100755 --- a/infoex-autowx.py +++ b/infoex-autowx.py @@ -77,18 +77,18 @@ wsdl = 'https://www.wcc.nrcs.usda.gov/awdbWebService/services?WSDL' try: infoex = { - 'host': config['ftp']['host'], - 'uuid': config['ftp']['uuid'], - 'api_key': config['ftp']['api_key'], - 'location_uuid': config['wxsite']['location_uuid'], + 'host': config['infoex']['host'], + 'uuid': config['infoex']['uuid'], + 'api_key': config['infoex']['api_key'], + 'location_uuid': config['infoex']['location_uuid'], 'wx_data': {}, # placeholder key, values to come later - 'csv_filename': config['wxsite']['csv_filename'] + 'csv_filename': config['infoex']['csv_filename'] } - station_triplet = config['wxsite']['station_triplet'] + station_triplet = config['nrcs']['station_triplet'] try: - desired_data = config['wxsite']['desired_data'].split(',') + desired_data = config['nrcs']['desired_data'].split(',') except: # desired_data malformed or missing, setting default desired_data = [ -- 2.30.2