import math
from seeparklib.openweathermap import openweathermap_json
-debug = False
-
def fromtimestamp(timestamp, format):
return datetime.datetime.fromtimestamp(timestamp).strftime(format)
])
-def main(configfile):
+def main(configfile, debug):
config = configparser.ConfigParser()
config.read(configfile)
apikey = config.get('openweathermap', 'apikey')
default_config_file = os.path.expanduser('~/seewasser.ini')
parser = argparse.ArgumentParser(description='Get OpenWeathermap data')
parser.add_argument('--config', default=default_config_file, help='configuration file')
+ parser.add_argument('--debug', action='store_true', default=False, help='print debug information')
args = parser.parse_args()
- main(args.config)
+ main(args.config, args.debug)