Changed the string formatter from % to f"",
Fixed a bug related to logging [log dir does not exist on master, and needs to get created on first startup] Added !prefadmin <user> to view preferences of players, and change them Orgrank & name will be hidden in !alts, if the character is not in an org Page prefix & suffix are now being relayed [for example, it affects !online Fixed !perks Added comments regarding external API's.
This commit is contained in:
@@ -47,16 +47,15 @@ class MessageHubService:
|
||||
invalid_sources = []
|
||||
if len(inspect.signature(callback).parameters) != 1:
|
||||
raise Exception(
|
||||
"Incorrect number of arguments for handler '%s.%s()'" % (callback.__module__, callback.__name__))
|
||||
f"Incorrect number of arguments for handler '{callback.__module__}.{callback.__name__}()'")
|
||||
|
||||
if destination in self.hub:
|
||||
raise Exception("Message hub destination '%s' already subscribed" % destination)
|
||||
raise Exception(f"Message hub destination '{destination}' already subscribed")
|
||||
|
||||
for source in default_sources:
|
||||
if source not in self.sources:
|
||||
self.logger.warning(
|
||||
"Could not subscribe destination '%s' to source '%s' because source does not exist" % (
|
||||
destination, source))
|
||||
f"Could not subscribe destination '{destination}' to source '{source}' because source does not exist")
|
||||
|
||||
self.hub[destination] = (DictObject({"name": destination,
|
||||
"callback": callback,
|
||||
@@ -85,11 +84,11 @@ class MessageHubService:
|
||||
|
||||
def subscribe_to_source(self, destination, source):
|
||||
if source not in self.sources:
|
||||
raise Exception("Message hub source '%s' doeselecs not exist" % source)
|
||||
raise Exception(f"Message hub source '{source}' does not exist")
|
||||
|
||||
obj = self.hub.get(destination, None)
|
||||
if not obj:
|
||||
raise Exception("Message hub destination '%s' does not exist" % destination)
|
||||
raise Exception(f"Message hub destination '{destination}' does not exist")
|
||||
|
||||
if source not in obj.sources:
|
||||
self.db.exec("DELETE FROM message_hub_subscriptions WHERE destination = ?", [destination])
|
||||
@@ -105,7 +104,7 @@ class MessageHubService:
|
||||
|
||||
obj = self.hub.get(destination, None)
|
||||
if not obj:
|
||||
raise Exception("Message hub destination '%s' does not exist" % destination)
|
||||
raise Exception(f"Message hub destination '{destination}' does not exist")
|
||||
|
||||
if source in obj.sources:
|
||||
self.db.exec("DELETE FROM message_hub_subscriptions WHERE destination = ?", [destination])
|
||||
|
||||
Reference in New Issue
Block a user