Commit 118b1c65 authored by thopri's avatar thopri
Browse files

fixed command line parsing issue

parent fae40b03
...@@ -18,7 +18,7 @@ def main(): ...@@ -18,7 +18,7 @@ def main():
setup_file = '' setup_file = ''
mask_gui = False mask_gui = False
try: try:
opts, dummy_args = getopt.getopt(sys.argv[1:], "h:s:d:g", ["help", "setup=", "download_cmems=", "mask_gui"]) opts, dummy_args = getopt.getopt(sys.argv[1:], "hsdg", ["help", "setup=", "download_cmems=", "mask_gui"])
except getopt.GetoptError: except getopt.GetoptError:
print("usage: pynemo -g -s -d <namelist.bdy> ") print("usage: pynemo -g -s -d <namelist.bdy> ")
sys.exit(2) sys.exit(2)
......
...@@ -41,16 +41,19 @@ except ImportError: ...@@ -41,16 +41,19 @@ except ImportError:
import sys import sys
from pynemo import nemo_bdy_setup as setup from pynemo import nemo_bdy_setup as setup
Setup = setup.Setup(sys.argv[2]) # default settings file try:
settings = Setup.settings Setup = setup.Setup(sys.argv[2]) # default settings file
if 'use_cmems' in settings: settings = Setup.settings
if settings['use_cmems'] == True: if 'use_cmems' in settings:
time_counter_const = "time" if settings['use_cmems'] == True:
if settings['use_cmems'] == False: time_counter_const = "time"
if settings['use_cmems'] == False:
time_counter_const = "time_counter"
if 'use_cmems' not in settings:
time_counter_const = "time_counter" time_counter_const = "time_counter"
if 'use_cmems' not in settings: del settings, Setup
except IndexError:
time_counter_const = "time_counter" time_counter_const = "time_counter"
del settings, Setup
class Reader(object): class Reader(object):
""" This class is the high level of object for the NCML reader, from here using grid type """ This class is the high level of object for the NCML reader, from here using grid type
......
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