Commit 67505f90 authored by James Harle's avatar James Harle
Browse files

2to3 gui

parent 190d199b
......@@ -50,7 +50,7 @@ class Reader(object):
dir_list[i] = self.directory + dir_list[i]
dir_list.sort()
return filter(None, dir_list)
return [_f for _f in dir_list if _f]
def _delta_time_interval(self, time1, time2):
""" Get the difference between the two times in days and hours"""
......@@ -94,7 +94,7 @@ class Reader(object):
error"""
days = set()
hrs = set()
for grid_type in self.grid_source_data.keys():
for grid_type in list(self.grid_source_data.keys()):
day, hr = self._delta_time_interval(self.grid_source_data[grid_type].time_counter[0],
self.grid_source_data[grid_type].time_counter[1])
days.add(day)
......
......@@ -15,13 +15,13 @@ from netCDF4 import Dataset
def GetReader(uri, t_adjust, reader_type=None):
if reader_type is None:
print uri
print(uri)
if uri.endswith(".ncml"):
reader_type = "NcML"
elif os.path.isdir(uri):
reader_type = "Directory"
else:
print "Error input should be a NcML file or URL or a Local directory"
print("Error input should be a NcML file or URL or a Local directory")
return None
if reader_type == "NcML":
return NcMLReader(uri,t_adjust)
......
......@@ -22,7 +22,7 @@ try:
proxy_port = proxylist[1]
jnius_config.add_options('-Dhttp.proxyHost='+proxy_host,'-Dhttp.proxyPort='+proxy_port)
except:
print "Didn't find a proxy environment variable"
print("Didn't find a proxy environment variable")
NetcdfDataset = None
NcMLReader = None
Section = None
......@@ -37,7 +37,7 @@ try:
Section = autoclass('ucar.ma2.Section')
init_jnius()
except ImportError:
print 'Warning: Please make sure pyjnius is installed and jvm.dll/libjvm.so/libjvm.dylib is in the path'
print('Warning: Please make sure pyjnius is installed and jvm.dll/libjvm.so/libjvm.dylib is in the path')
time_counter_const = "time_counter"
class Reader(object):
......
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