@@ -144,12 +144,12 @@ async def apply_asset(self, asset_type: AssetType, download_url: str) -> bool:
144144
145145 Return a boolean indicating whether the application was successful.
146146 """
147- log .info (f "Applying '{ asset_type . value } ' asset to the guild." )
147+ log .info ("Applying '%s ' asset to the guild." , asset_type . value )
148148
149149 try :
150150 file = await self .repository .fetch_file (download_url )
151151 except Exception :
152- log .exception (f "Failed to fetch '{ asset_type . value } ' asset." )
152+ log .exception ("Failed to fetch '%s ' asset." , asset_type . value )
153153 return False
154154
155155 await self .bot .wait_until_guild_available ()
@@ -163,7 +163,7 @@ async def apply_asset(self, asset_type: AssetType, download_url: str) -> bool:
163163 log .exception ("Asset upload to Discord failed." )
164164 return False
165165 except TimeoutError :
166- log .error (f "Asset upload to Discord timed out after { timeout } seconds." )
166+ log .error ("Asset upload to Discord timed out after %s seconds." , timeout )
167167 return False
168168 else :
169169 log .trace ("Asset uploaded successfully." )
@@ -182,17 +182,17 @@ async def rotate_assets(self, asset_type: AssetType) -> bool:
182182
183183 Return a boolean indicating whether a new asset was applied successfully.
184184 """
185- log .debug (f "Rotating { asset_type .value } s." )
185+ log .debug ("Rotating %ss." , asset_type .value )
186186
187187 state = await self .asset_caches [asset_type ].to_dict ()
188188 log .trace (f"Total { asset_type .value } s in rotation: { len (state )} ." )
189189
190190 if not state : # This would only happen if rotation not initiated, but we can handle gracefully.
191- log .warning (f "Attempted { asset_type . value } rotation with an empty cache. This indicates wrong logic." )
191+ log .warning ("Attempted %s rotation with an empty cache. This indicates wrong logic." , asset_type . value )
192192 return False
193193
194194 if len (state ) == 1 and 1 in state .values ():
195- log .debug (f "Aborting { asset_type . value } rotation: only 1 asset is available and has already been applied." )
195+ log .debug ("Aborting %s rotation: only 1 asset is available and has already been applied." , asset_type . value )
196196 return False
197197
198198 current_iteration = min (state .values ()) # Choose iteration to draw from.
@@ -219,7 +219,7 @@ async def maybe_rotate_assets(self, asset_type: AssetType) -> None:
219219 is work to be done before the timestamp is read and written, the next read will likely commence slightly
220220 under 24 hours after the last write.
221221 """
222- log .debug (f "Checking whether it's time for { asset_type . value } s to rotate." )
222+ log .debug ("Checking whether it's time for %ss to rotate." , asset_type . value )
223223
224224 last_rotation_timestamp = await self .cache_information .get (f"last_{ asset_type .value } _rotation_timestamp" )
225225
@@ -245,7 +245,7 @@ async def initiate_rotation(self, asset_type: AssetType, available_assets: list[
245245
246246 This function does not upload a new asset!
247247 """
248- log .debug (f "Initiating new { asset_type . value } rotation." )
248+ log .debug ("Initiating new %s rotation." , asset_type . value )
249249
250250 await self .asset_caches [asset_type ].clear ()
251251
@@ -265,13 +265,17 @@ async def send_info_embed(self, channel_id: int, *, is_notification: bool) -> No
265265 We read event information from `cache_information`. The caller is therefore responsible for making
266266 sure that the cache is up-to-date before calling this function.
267267 """
268- log .debug (f"Sending event information event to channel: { channel_id } ({ is_notification = } )." )
268+ log .debug (
269+ "Sending event information event to channel: %s (is_notification=%r)." ,
270+ channel_id ,
271+ is_notification ,
272+ )
269273
270274 await self .bot .wait_until_guild_available ()
271275 channel : discord .TextChannel | None = self .bot .get_channel (channel_id )
272276
273277 if channel is None :
274- log .warning (f "Cannot send event information: channel { channel_id } not found!" )
278+ log .warning ("Cannot send event information: channel %s not found!" , channel_id )
275279 return
276280
277281 log .trace (f"Destination channel: #{ channel .name } ." )
@@ -304,7 +308,7 @@ async def enter_event(self, event: Event) -> tuple[bool, bool]:
304308
305309 Return a 2-tuple indicating whether the banner, and the icon, were applied successfully.
306310 """
307- log .info (f "Entering event: '{ event . path } '." )
311+ log .info ("Entering event: '%s '." , event . path )
308312
309313 # Prepare and apply new icon and banner rotations
310314 await self .initiate_rotation (AssetType .ICON , event .icons )
@@ -571,7 +575,7 @@ async def branding_calendar_group(self, ctx: commands.Context) -> None:
571575 first_25 = list (available_events .items ())[:25 ]
572576
573577 if len (first_25 ) != len (available_events ): # Alert core devs that a paginating solution is now necessary.
574- log .warning (f "There are { len ( available_events ) } events, but the calendar view can only display 25." )
578+ log .warning ("There are %s events, but the calendar view can only display 25." , len ( available_events ) )
575579
576580 for name , duration in first_25 :
577581 embed .add_field (name = name [:256 ], value = duration [:1024 ])
0 commit comments