diff --git a/.gitignore b/.gitignore index 0e5b2d9..18b6291 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ __pycache__/ *.swp +*.tmp chutney.cfg weather.txt diff --git a/weather_display.py b/weather_display.py index 8c405e2..7039d35 100644 --- a/weather_display.py +++ b/weather_display.py @@ -7,21 +7,21 @@ class WeatherDisplay: self.topRow = topRow self.twoDigitStartColumn = 9 self.oneDigitStartColumn = 13 + self.digitWidth = 4 self.currentTemperature = '' - self.color = colors.GREEN + self.color = colors.BLUE self.weatherFile = 'weather.txt' def showWeather(self): temperature = self.getTemperature() if temperature != self.currentTemperature: + self.currentTemperature = temperature self.characterDisplay.clearRow(self.topRow) if self.isTemperatureValid(temperature): self.showTemperature(list(temperature)) - self.currentTemperature = temperature - def getTemperature(self): try: with open(self.weatherFile) as file: @@ -50,7 +50,7 @@ class WeatherDisplay: digit=c, color=self.color ) - start = start + 4 + start = start + self.digitWidth def getStartColumn(self, temperature): return self.oneDigitStartColumn if (self.isOneDigit(temperature)) else self.twoDigitStartColumn