Commit f04a5fed authored by Javier Quinteros's avatar Javier Quinteros

Clean old comments and code unused code snippets

parent ed328950
...@@ -398,7 +398,6 @@ class StationAPI(object): ...@@ -398,7 +398,6 @@ class StationAPI(object):
# However it is the best to merge time windows from files int one epoch # However it is the best to merge time windows from files int one epoch
# This allows to construct the generator returning one line at each iteration # This allows to construct the generator returning one line at each iteration
for ch in channels: for ch in channels:
cherrypy.log('Channel %s' % ch)
t = TDMS(self.__experiment, directory=self.__directory, starttime=starttime, endtime=endtime, iterate='M', t = TDMS(self.__experiment, directory=self.__directory, starttime=starttime, endtime=endtime, iterate='M',
channels=[ch]) channels=[ch])
result = dict() result = dict()
...@@ -423,21 +422,15 @@ class StationAPI(object): ...@@ -423,21 +422,15 @@ class StationAPI(object):
# yield json.dumps(data, default=datetime.isoformat) # yield json.dumps(data, default=datetime.isoformat)
if data['data']: if data['data']:
# cherrypy.log('%s' % data)
stt = data['starttime'] stt = data['starttime']
ent = data['endtime'] ent = data['endtime']
if level == 'station': if level == 'station':
key = 'XX|%s||FH1|%s|%s|%s|SiteName' % (data['id'], lat, lon, elev) key = 'XX|%s||FH1|%s|%s|%s|SiteName' % (data['id'], lat, lon, elev)
# text = 'XX|%s||FH1|%s|%s|%s|SiteName|%s|%s\n' %\
# (data['id'], lat, lon, elev, stt.isoformat(), ent.isoformat())
else: else:
key = 'XX|%s||FH1|%s|%s|%s|depth|azimuth|dip|DAS|Scale|ScaleFrequency|ScaleUnits|%s' % \ key = 'XX|%s||FH1|%s|%s|%s|depth|azimuth|dip|DAS|Scale|ScaleFrequency|ScaleUnits|%s' % \
(data['id'], lat, lon, elev, samprate) (data['id'], lat, lon, elev, samprate)
# text = 'XX|%s||FH1|%s|%s|%s|depth|azimuth|dip|DAS|Scale|ScaleFrequency|ScaleUnits|%s|%s|%s\n' %\
# (data['id'], lat, lon, elev, samprate, stt.isoformat(), ent.isoformat())
if key in result: if key in result:
# Get the minimum starttime # Get the minimum starttime
stt = stt if stt < result[key][0] else result[key][0] stt = stt if stt < result[key][0] else result[key][0]
...@@ -451,7 +444,6 @@ class StationAPI(object): ...@@ -451,7 +444,6 @@ class StationAPI(object):
# Key is in the proper format for station or channel level. We only need to add the start and end time # Key is in the proper format for station or channel level. We only need to add the start and end time
text = '%s|%s|%s\n' % (key, stt.isoformat(), ent.isoformat()) text = '%s|%s|%s\n' % (key, stt.isoformat(), ent.isoformat())
# yield json.dumps(data, default=datetime.isoformat)
yield text yield text
return return
...@@ -631,7 +623,6 @@ class DataselectAPI(object): ...@@ -631,7 +623,6 @@ class DataselectAPI(object):
except Exception: except Exception:
# Send Error 400 # Send Error 400
message = 'Wrong formatted list of stations (%s).' % sta message = 'Wrong formatted list of stations (%s).' % sta
# self.log.error(message)
cherrypy.response.headers['Content-Type'] = 'text/plain' cherrypy.response.headers['Content-Type'] = 'text/plain'
raise cherrypy.HTTPError(400, errormessage(400, message)) raise cherrypy.HTTPError(400, errormessage(400, message))
...@@ -641,7 +632,6 @@ class DataselectAPI(object): ...@@ -641,7 +632,6 @@ class DataselectAPI(object):
except Exception: except Exception:
# Send Error 400 # Send Error 400
message = 'Error converting the "starttime" parameter (%s).' % starttime message = 'Error converting the "starttime" parameter (%s).' % starttime
# self.log.error(message)
cherrypy.response.headers['Content-Type'] = 'text/plain' cherrypy.response.headers['Content-Type'] = 'text/plain'
raise cherrypy.HTTPError(400, errormessage(400, message)) raise cherrypy.HTTPError(400, errormessage(400, message))
else: else:
...@@ -653,7 +643,6 @@ class DataselectAPI(object): ...@@ -653,7 +643,6 @@ class DataselectAPI(object):
except Exception: except Exception:
# Send Error 400 # Send Error 400
message = 'Error converting the "endtime" parameter (%s).' % endtime message = 'Error converting the "endtime" parameter (%s).' % endtime
# self.log.error(message)
cherrypy.response.headers['Content-Type'] = 'text/plain' cherrypy.response.headers['Content-Type'] = 'text/plain'
raise cherrypy.HTTPError(400, errormessage(400, message)) raise cherrypy.HTTPError(400, errormessage(400, message))
else: else:
...@@ -720,7 +709,6 @@ def main(): ...@@ -720,7 +709,6 @@ def main():
# Read general parameters # Read general parameters
experiment = config.get('General', 'experiment') experiment = config.get('General', 'experiment')
# logging.basicConfig(level=loglevel)
server_config = { server_config = {
'global': { 'global': {
......
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