Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def hourly(data_dir):
with pywws.storage.pywws_context(data_dir) as context:
# localise application
pywws.localisation.set_application_language(context.params)
# get weather station data
pywws.logdata.DataLogger(context).log_data()
# do the processing
pywws.process.process_data(context)
# do tasks
pywws.regulartasks.RegularTasks(context).do_tasks()
return 0
print('Error: %s\n' % msg, file=sys.stderr)
print(__usage__.strip(), file=sys.stderr)
return 1
# check arguments
if len(args) != 3:
print('Error: 3 arguments required\n', file=sys.stderr)
print(__usage__.strip(), file=sys.stderr)
return 2
# process options
for o, a in opts:
if o == '--help':
print(__usage__.strip())
return 0
pywws.logger.setup_handler(1)
with pywws.storage.pywws_context(args[0]) as context:
pywws.localisation.set_application_language(context.params)
return Template(context).make_file(args[1], args[2])