Commit 78941e5c authored by James Harle's avatar James Harle
Browse files

2to3

parent 01b364e4
......@@ -245,13 +245,13 @@ def process_bdy(setup_filepath=0, mask_gui=False):
'values in input bdy file')
return
yrs = range(yr_000, yr_end+1)
yrs = list(range(yr_000, yr_end+1))
if yr_end - yr_000 >= 1:
if range(mn_000, mn_end+1) < 12:
if list(range(mn_000, mn_end+1)) < 12:
logger.info('Warning: All months will be extracted as the number '+
'of years is greater than 1')
mns = range(1,13)
mns = list(range(1,13))
else:
mn_000 = settings['month_000']
mn_end = settings['month_end']
......@@ -259,7 +259,7 @@ def process_bdy(setup_filepath=0, mask_gui=False):
logging.error('Please check the nn_month_000 and nn_month_end '+
'values in input bdy file')
return
mns = range(mn_000, mn_end+1)
mns = list(range(mn_000, mn_end+1))
# Enter the loop for each year and month extraction
......@@ -312,7 +312,7 @@ def process_bdy(setup_filepath=0, mask_gui=False):
# Initialise the mapping indices for each grid
for key, val in emap.items():
for key, val in list(emap.items()):
extract_obj[key] = extract.Extract(Setup.settings,
SourceCoord, DstCoord,
......@@ -325,7 +325,7 @@ def process_bdy(setup_filepath=0, mask_gui=False):
for year in yrs:
for month in mns:
for key, val in emap.items():
for key, val in list(emap.items()):
# Extract the data for a given month and year
......@@ -380,7 +380,7 @@ def write_tidal_data(setup_var, dst_coord_var, grid, tide_cons, cons):
const_name = setup_var.settings['clname'][tide_con]
const_name = const_name.replace("'", "").upper()
for key,val in tmap.items():
for key,val in list(tmap.items()):
fout_tide = setup_var.settings['dst_dir']+ \
setup_var.settings['fn']+ \
......
......@@ -5,7 +5,7 @@ Entry for the project
'''
import sys, getopt
import profile
from . import profile
import logging
# Logging set to info
......@@ -20,14 +20,14 @@ def main():
try:
opts, dummy_args = getopt.getopt(sys.argv[1:], "hs:g", ["help","setup=","mask_gui"])
except getopt.GetoptError:
print "usage: pynemo -g -s <namelist.bdy> "
print("usage: pynemo -g -s <namelist.bdy> ")
sys.exit(2)
for opt, arg in opts:
if opt == "-h":
print "usage: pynemo [-g] -s <namelist.bdy> "
print " -g (optional) will open settings editor before extracting the data"
print " -s <bdy filename> file to use"
print("usage: pynemo [-g] -s <namelist.bdy> ")
print(" -g (optional) will open settings editor before extracting the data")
print(" -s <bdy filename> file to use")
sys.exit()
elif opt in ("-s", "--setup"):
setup_file = arg
......@@ -35,7 +35,7 @@ def main():
mask_gui = True
if setup_file == "":
print "usage: pynemo [-g] -s <namelist.bdy> "
print("usage: pynemo [-g] -s <namelist.bdy> ")
sys.exit(2)
#Logger
......@@ -43,7 +43,7 @@ def main():
t0 = time.time()
profile.process_bdy(setup_file, mask_gui)
t1 = time.time()
print "Execution Time: %s" % (t1-t0)
print("Execution Time: %s" % (t1-t0))
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