minor code improvement

use format strings
This commit is contained in:
caryoscelus 2022-11-27 09:33:48 +00:00
parent 0475a39fe1
commit f88260a770

View file

@ -38,7 +38,7 @@ class SiteManagerPlugin(object):
block_details = None
if block_details:
raise Exception("Site blocked: %s" % html.escape(block_details.get("reason", "unknown reason")))
raise Exception(f'Site blocked: {html.escape(block_details.get("reason", "unknown reason"))}')
else:
return super(SiteManagerPlugin, self).add(address, *args, **kwargs)
@ -204,15 +204,15 @@ class SiteStoragePlugin(object):
# Check if any of the adresses are in the mute list
for auth_address in matches:
if filter_storage.isMuted(auth_address):
self.log.debug("Mute match: %s, ignoring %s" % (auth_address, inner_path))
self.log.debug(f'Mute match: {auth_address}, ignoring {inner_path}')
return False
return super(SiteStoragePlugin, self).updateDbFile(inner_path, file=file, cur=cur)
def onUpdated(self, inner_path, file=None):
file_path = "%s/%s" % (self.site.address, inner_path)
if file_path in filter_storage.file_content["includes"]:
self.log.debug("Filter file updated: %s" % inner_path)
file_path = f'{self.site.address}/{inner_path}'
if file_path in filter_storage.file_content['includes']:
self.log.debug('Filter file updated: {inner_path}')
filter_storage.includeUpdateAll()
return super(SiteStoragePlugin, self).onUpdated(inner_path, file=file)