minor code improvement
use format strings
This commit is contained in:
parent
0475a39fe1
commit
f88260a770
1 changed files with 5 additions and 5 deletions
|
@ -38,7 +38,7 @@ class SiteManagerPlugin(object):
|
||||||
block_details = None
|
block_details = None
|
||||||
|
|
||||||
if block_details:
|
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:
|
else:
|
||||||
return super(SiteManagerPlugin, self).add(address, *args, **kwargs)
|
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
|
# Check if any of the adresses are in the mute list
|
||||||
for auth_address in matches:
|
for auth_address in matches:
|
||||||
if filter_storage.isMuted(auth_address):
|
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 False
|
||||||
|
|
||||||
return super(SiteStoragePlugin, self).updateDbFile(inner_path, file=file, cur=cur)
|
return super(SiteStoragePlugin, self).updateDbFile(inner_path, file=file, cur=cur)
|
||||||
|
|
||||||
def onUpdated(self, inner_path, file=None):
|
def onUpdated(self, inner_path, file=None):
|
||||||
file_path = "%s/%s" % (self.site.address, inner_path)
|
file_path = f'{self.site.address}/{inner_path}'
|
||||||
if file_path in filter_storage.file_content["includes"]:
|
if file_path in filter_storage.file_content['includes']:
|
||||||
self.log.debug("Filter file updated: %s" % inner_path)
|
self.log.debug('Filter file updated: {inner_path}')
|
||||||
filter_storage.includeUpdateAll()
|
filter_storage.includeUpdateAll()
|
||||||
return super(SiteStoragePlugin, self).onUpdated(inner_path, file=file)
|
return super(SiteStoragePlugin, self).onUpdated(inner_path, file=file)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue