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

fixed command line parsing issue

parent fae40b03
......@@ -18,7 +18,7 @@ def main():
setup_file = ''
mask_gui = False
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:
print("usage: pynemo -g -s -d <namelist.bdy> ")
sys.exit(2)
......
......@@ -41,16 +41,19 @@ except ImportError:
import sys
from pynemo import nemo_bdy_setup as setup
Setup = setup.Setup(sys.argv[2]) # default settings file
settings = Setup.settings
if 'use_cmems' in settings:
if settings['use_cmems'] == True:
time_counter_const = "time"
if settings['use_cmems'] == False:
try:
Setup = setup.Setup(sys.argv[2]) # default settings file
settings = Setup.settings
if 'use_cmems' in settings:
if settings['use_cmems'] == True:
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"
if 'use_cmems' not in settings:
del settings, Setup
except IndexError:
time_counter_const = "time_counter"
del settings, Setup
class Reader(object):
""" 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