Work towards 2020 idiomatic Python
authorAlexander Vasarab <alexander@wylark.com>
Wed, 17 Jun 2020 19:54:38 +0000 (12:54 -0700)
committerAlexander Vasarab <alexander@wylark.com>
Wed, 17 Jun 2020 19:54:38 +0000 (12:54 -0700)
infoex-autowx.py

index d62b1e642141486c882594d0ee89110d80543372..a4e50a931f2fc9324174a3d9875441b6889833d4 100755 (executable)
@@ -1,39 +1,42 @@
-#!/usr/bin/python3
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
 
 
-#
-InfoEx <-> NRCS Auto Wx implementation
-Alexander Vasarab
-Wylark Mountaineering LLC
-#
-Version 1.0.0
-#
-This program fetches data from an NRCS SNOTEL site and pushes it to
-InfoEx using the new automated weather system implementation.
-#
-It is designed to be run hourly, and it asks for the last three hours
-of data of each desired type, and selects the most recent one. This
-lends some resiliency to the process and helps ensure that we have a
-value to send, but it can lead to somewhat inconsistent/untruthful
-data if e.g. the HS is from the last hour but the tempPres is from two
-hours ago because the instrumentation had a hiccup. It's worth
-considering if this is a bug or a feature.
-#
-For more information, see file: README
-For licensing, see file: LICENSE
-#
+"""
+InfoEx <-> NRCS Auto Wx implementation
+Alexander Vasarab
+Wylark Mountaineering LLC
+
+Version 1.0.0
+
+This program fetches data from an NRCS SNOTEL site and pushes it to
+InfoEx using the new automated weather system implementation.
+
+It is designed to be run hourly, and it asks for the last three hours
+of data of each desired type, and selects the most recent one. This
+lends some resiliency to the process and helps ensure that we have a
+value to send, but it can lead to somewhat inconsistent/untruthful
+data if e.g. the HS is from the last hour but the tempPres is from two
+hours ago because the instrumentation had a hiccup. It's worth
+considering if this is a bug or a feature.
+
+For more information, see file: README
+For licensing, see file: LICENSE
+"""
 
 import configparser
 import csv
 import datetime
 import logging
 import time
 
 import configparser
 import csv
 import datetime
 import logging
 import time
-import zeep
-import zeep.cache
-import zeep.transports
+
 from collections import OrderedDict
 from ftplib import FTP
 from optparse import OptionParser
 
 from collections import OrderedDict
 from ftplib import FTP
 from optparse import OptionParser
 
+import zeep
+import zeep.cache
+import zeep.transports
+
 log = logging.getLogger(__name__)
 log.setLevel(logging.DEBUG)
 
 log = logging.getLogger(__name__)
 log.setLevel(logging.DEBUG)