Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from view.view import View
- from model.weather import Weather
- from model.mapbox import MapBox
- class Controller:
- def __init__(self) -> None:
- self.view = View(self)
- self.weather = Weather()
- self.mapbox = MapBox()
- self.updateGUI()
- def main(self):
- self.view.main()
- def updateGUI(self):
- if 'error' not in self.weather.weatherData:
- self.view.varLocation.set(self.weather.getLocation())
- self.view.varCondition.set(self.weather.getConditionText())
- def handleButtonSearch(self, event=None):
- location = self.view.varSearch.get()
- if location != '':
- self.weather = Weather(location)
- self.updateGUI()
- def handleComboSearch(self, event=None):
- location = self.view.varSearch.get()
- if len(location) > 3:
- self.mapbox.updateQuery(location)
- self.view.comboSearch.configure(values=self.mapbox.getNames())
- else:
- self.view.comboSearch.configure(values=[])
Advertisement
Add Comment
Please, Sign In to add comment