@@ -96,17 +96,17 @@ def check_games_scheduled(self):
96
96
sleep_seconds = int ((first_game_start - datetime .datetime .utcnow ()).total_seconds ())
97
97
if sleep_seconds >= 6600 :
98
98
# hour and 50 minutes or more just display hours
99
- delay_time = "%s hours" % round (sleep_seconds / 3600 )
99
+ delay_time = f" { round (sleep_seconds / 3600 )} hours"
100
100
elif sleep_seconds >= 4200 :
101
101
# hour and 10 minutes
102
- delay_time = "an hour and %s minutes" % round ((sleep_seconds / 60 ) - 60 )
102
+ delay_time = f "an hour and { round ((sleep_seconds / 60 ) - 60 )} minutes"
103
103
elif sleep_seconds >= 3000 :
104
104
# 50 minutes
105
105
delay_time = "an hour"
106
106
else :
107
- delay_time = "%s minutes" % round ((sleep_seconds / 60 ))
107
+ delay_time = f" { round ((sleep_seconds / 60 ))} minutes"
108
108
109
- message = "First game starts in about %s" % delay_time
109
+ message = f "First game starts in about { delay_time } "
110
110
self .notify (self .local_string (30300 ), message )
111
111
self .monitor .waitForAbort (sleep_seconds )
112
112
@@ -149,7 +149,7 @@ def get_new_stats(self, game):
149
149
150
150
game_clock = game ['status' ]['detailedState' ]
151
151
if 'in progress' in game_clock .lower ():
152
- game_clock = '%s %s' % ( game ['linescore' ]['currentPeriodTimeRemaining' ], game ['linescore' ]['currentPeriodOrdinal' ])
152
+ game_clock = f" { game ['linescore' ]['currentPeriodTimeRemaining' ]} { game ['linescore' ]['currentPeriodOrdinal' ]} "
153
153
154
154
# Disable spoiler by not showing score notifications for the game the user is currently watching
155
155
if ateam .lower () not in video_playing and hteam .lower () not in video_playing :
@@ -175,45 +175,46 @@ def final_score_message(self, new_item):
175
175
# Highlight score of the winning team
176
176
title = self .local_string (30355 )
177
177
if new_item ['away_score' ] > new_item ['home_score' ]:
178
- away_score = ' [COLOR=%s]%s %s[/COLOR]' % ( self .score_color , new_item ['away_name' ], new_item ['away_score' ])
179
- home_score = '%s %s' % ( new_item ['home_name' ], new_item ['home_score' ])
178
+ away_score = f" [COLOR={ self .score_color } ] { new_item ['away_name' ]} { new_item ['away_score' ]} [/COLOR]"
179
+ home_score = f" { new_item ['home_name' ]} { new_item ['home_score' ]} "
180
180
else :
181
- away_score = '%s %s' % ( new_item ['away_name' ], new_item ['away_score' ])
182
- home_score = ' [COLOR=%s]%s %s[/COLOR]' % ( self .score_color , new_item ['home_name' ], new_item ['home_score' ])
181
+ away_score = f" { new_item ['away_name' ]} { new_item ['away_score' ]} "
182
+ home_score = f" [COLOR={ self .score_color } ] { new_item ['home_name' ]} { new_item ['home_score' ]} [/COLOR]"
183
183
184
- game_clock = ' [COLOR=%s]%s[/COLOR]' % ( self .gametime_color , new_item ['game_clock' ])
185
- message = '%s %s %s' % ( away_score , home_score , game_clock )
184
+ game_clock = f" [COLOR={ self .gametime_color } ] { new_item ['game_clock' ]} [/COLOR]"
185
+ message = f" { away_score } { home_score } { game_clock } "
186
186
return title , message
187
187
188
188
def game_started_message (self , new_item ):
189
189
title = self .local_string (30358 )
190
- message = '%s vs %s' % ( new_item ['away_name' ], new_item ['home_name' ])
190
+ message = f" { new_item ['away_name' ]} vs { new_item ['home_name' ]} "
191
191
return title , message
192
192
193
193
def period_change_message (self , new_item ):
194
194
# Notify user that the game has started / period has changed
195
195
title = self .local_string (30370 )
196
- message = '%s %s %s %s [COLOR=%s]%s has started[/COLOR]' % \
197
- (new_item ['away_name' ], new_item ['away_score' ], new_item ['home_name' ], new_item ['home_score' ],
198
- self .gametime_color , new_item ['period' ])
196
+ message = f"{ new_item ['away_name' ]} { new_item ['away_score' ]} " \
197
+ f"{ new_item ['home_name' ]} { new_item ['home_score' ]} " \
198
+ f"[COLOR={ self .gametime_color } ]{ new_item ['period' ]} has started[/COLOR]"
199
+
199
200
return title , message
200
201
201
202
def goal_scored_message (self , new_item , old_item ):
202
203
# Highlight score for the team that just scored a goal
203
- away_score = '%s %s' % ( new_item ['away_name' ], new_item ['away_score' ])
204
- home_score = '%s %s' % ( new_item ['home_name' ], new_item ['home_score' ])
205
- game_clock = ' [COLOR=%s]%s[/COLOR]' % ( self .gametime_color , new_item ['game_clock' ])
204
+ away_score = f" { new_item ['away_name' ]} { new_item ['away_score' ]} "
205
+ home_score = f" { new_item ['home_name' ]} { new_item ['home_score' ]} "
206
+ game_clock = f" [COLOR={ self .gametime_color } ] { new_item ['game_clock' ]} [/COLOR]"
206
207
207
208
if new_item ['away_score' ] != old_item ['away_score' ]:
208
- away_score = ' [COLOR=%s]%s [/COLOR]' % ( self . score_color , away_score )
209
+ away_score = f" [COLOR={ self . score_color } ] { away_score } [/COLOR]"
209
210
if new_item ['home_score' ] != old_item ['home_score' ]:
210
- home_score = ' [COLOR=%s]%s [/COLOR]' % ( self . score_color , home_score )
211
+ home_score = f" [COLOR={ self . score_color } ] { home_score } [/COLOR]"
211
212
212
213
if self .addon .getSetting (id = "goal_desc" ) == 'false' :
213
214
title = self .local_string (30365 )
214
- message = '%s %s %s' % ( away_score , home_score , game_clock )
215
+ message = f" { away_score } { home_score } { game_clock } "
215
216
else :
216
- title = '%s %s %s' % ( away_score , home_score , game_clock )
217
+ title = f" { away_score } { home_score } { game_clock } "
217
218
message = new_item ['goal_desc' ]
218
219
219
220
return title , message
0 commit comments