Skip to content

Commit

Permalink
fix to key window script
Browse files Browse the repository at this point in the history
  • Loading branch information
Aatman1 committed Oct 29, 2024
1 parent 31ac168 commit ca49928
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions clocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def initUI(self):
self.get_forecast()

def get_forecast(self):
api_key = "def2979ffa5d043e73a1af06b987a29c" # Replace with your OpenWeatherMap API key
api_key = "430fcb536af73ade963483b1944d63ae" # Replace with your OpenWeatherMap API key
url = f"http://api.openweathermap.org/data/2.5/forecast?lat={self.lat}&lon={self.lon}&appid={api_key}&units=metric"
try:
response = requests.get(url)
Expand Down Expand Up @@ -511,7 +511,7 @@ def update_times(self):
self.update_weather(section, section.location_info[2], section.location_info[3])

def update_weather(self, section, lat, lon):
api_key = "def2979ffa5d043e73a1af06b987a29c" # Replace with your OpenWeatherMap API key
api_key = "430fcb536af73ade963483b1944d63ae" # Replace with your OpenWeatherMap API key
url = f"http://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid={api_key}&units=metric"
try:
response = requests.get(url)
Expand Down
6 changes: 3 additions & 3 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ def update_times(self):
section.clock.update_time(current_time, city[:3].upper(), country_code)
section.country_shape.update_country(country_code)

# Update other UI elements every 30 seconds
if datetime.now().second % 30 == 0:
# Update other UI elements every 10 seconds
if datetime.now().second % 10 == 0:
for i, section in enumerate(self.location_sections):
city, _, _, _, country_code = section.location_info
country = pycountry.countries.get(alpha_2=country_code)
Expand Down Expand Up @@ -547,7 +547,7 @@ def update_times(self):
self.update_weather(section, section.location_info[2], section.location_info[3])

def update_weather(self, section, lat, lon):
api_key = "key" # Replace with your OpenWeatherMap API key
api_key = "430fcb536af73ade963483b1944d63ae" # Replace with your OpenWeatherMap API key
url = f"http://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid={api_key}&units=metric"
try:
response = requests.get(url)
Expand Down

0 comments on commit ca49928

Please sign in to comment.