Commit dbc90929 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

test

parent d614b74c
{
"setting": {
"forecastMethod": "HIRLAM",
"outletType": "AREA",
"forwardCalculation": "true",
"start": "STARTDATE",
"end": "ENDDATE",
"calculationType": "Oil classes",
"substance": "Medium oils (100-1000 cSt)",
"fresh": "true",
"winddrag": "0.00",
"outletPoints": "3",
"depth": "0",
"instantaneous": "true",
"amount": "100",
"amountUnit": "m3",
"duration": "24",
"durationUnit": "hours",
"uncertainty": "false",
"calculationMode": "Normal"
},
"coordinate": [{
"latitude": 60.356127978060933,
"longitude": 26.961650443838113
}, {
"latitude": 60.348048724559071,
"longitude": 26.934164170849897
}, {
"latitude": 60.357731733846322,
"longitude": 26.935840154054311
}, {
"latitude": 60.362457652517769,
"longitude": 26.958385167216541
}],
"timeperiod": 24
}
\ No newline at end of file
......@@ -2,16 +2,45 @@
# coding: utf-8
import json
import ConfigParser as cp
from pprint import pprint
from ConfigParser import SafeConfigParser
global settings
settings = cp.ConfigParser()
settings.read('run.cfg')
class Runner_HELCOM_NEMO:
# class RegexValidator(object):
# def __call__(self, value):
# # validation logic
# class URLValidator(RegexValidator):
# def __call__(self, value):
# super(URLValidator, self).__call__(value)
# #additional logic
# class EmailValidator(RegexValidator):
# # some logic
# for v in [custom_validator, EmailValidator()]:
# v(value) # <-----
class Runner:
def __init__(self):
self.data = []
settings = SafeConfigParser()
settings.read('run/run.cfg')
self.url = settings.get('misc', 'url');
self.usr = settings.get('misc', 'usr');
self.pwd = settings.get('misc', 'pwd');
def __call__(self):
usr = self.settings.get('misc', 'usr');
pwd = self.settings.get('misc', 'pwd');
print usr, pwd
pprint(helcom_nemo_1)
class HELCOM_NEMO:
def __init__(self):
with open('run/helcom_nemo_1.json') as helcom_nemo_1_file:
self.helcom_nemo_1 = json.load(helcom_nemo_1_file)
def __call__(self):
super(Runner, self).__call__(value)
'''
#!/bin/bash
......@@ -30,7 +59,8 @@ class Runner_HELCOM_NEMO:
return ""
def main():
Runner_HELCOM_NEMO()
for v in [HELCOM_NEMO()]:
v() # <-----
if __name__ == "__main__":
main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment