comparison weather_server/locations.py @ 22:e229afdd447b

locations.py: store location name into the right place.
author Paul Fisher <paul@pfish.zone>
date Fri, 01 Nov 2019 00:48:56 -0400
parents beb42c835c52
children 20c8ec56e447
comparison
equal deleted inserted replaced
21:beb42c835c52 22:e229afdd447b
25 self.root = root 25 self.root = root
26 config_file = root / CONFIG_FILE 26 config_file = root / CONFIG_FILE
27 try: 27 try:
28 with open(config_file, 'r') as infile: 28 with open(config_file, 'r') as infile:
29 parser.read_file(infile) 29 parser.read_file(infile)
30 self.location = parser.get( 30 self.name = parser.get(
31 'location', 'name', fallback='Weather station') 31 'location', 'name', fallback='Weather station')
32 self.tz_name = parser.get('location', 'timezone', fallback='UTC') 32 self.tz_name = parser.get('location', 'timezone', fallback='UTC')
33 self.password = parser.get('location', 'password') 33 self.password = parser.get('location', 'password')
34 self.logger = logfile.Logger.create( 34 self.logger = logfile.Logger.create(
35 str(root / LOG), sample_field='sample_time') 35 str(root / LOG), sample_field='sample_time')