Commit b9a390cc authored by Javier Quinteros's avatar Javier Quinteros

Add attribute sitename to the output of StationWS

parent 423de6d0
......@@ -143,6 +143,8 @@ class StationAPI(object):
if self.__loc == '':
self.__loc = '--'
self.__sitename = cfgfile.get('General', 'siteName', fallback='Unknown sitename')
@cherrypy.expose
def index(self, wsversion='1'):
if wsversion != '1':
......@@ -419,7 +421,7 @@ class StationAPI(object):
stt = data['starttime']
ent = data['endtime']
if level == 'station':
key = 'XX|%s||FH1|%s|%s|%s|SiteName' % (data['id'], lat, lon, elev)
key = 'XX|%s||FH1|%s|%s|%s|%s' % (data['id'], lat, lon, elev, self.__sitename)
else:
key = 'XX|%s||FH1|%s|%s|%s|depth|azimuth|dip|DAS|Scale|ScaleFrequency|ScaleUnits|%s' % \
(data['id'], lat, lon, elev, samprate)
......@@ -690,7 +692,7 @@ def main():
if args.minimalconfig:
# Create default sections and options for the configfile
config['General'] = {'experiment': 'filename', 'loglevel': 'INFO'}
config['General'] = {'experiment': 'filename', 'loglevel': 'INFO', 'siteName': 'Site description for StationWS'}
config['NSLC'] = {'network': 'XX', 'location': '', 'channel': 'FH1'}
# Write to tdmsws.cfg
with open('tdmsws.cfg', 'w') as configfile:
......
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