Black cleanup

This commit is contained in:
James Barnsley
2020-08-21 22:38:39 +12:00
parent b6b2f66506
commit 177dce8797

View File

@ -60,7 +60,7 @@ class IrisCore(pykka.ThreadingActor):
logger.info("Starting Iris " + Extension.version) logger.info("Starting Iris " + Extension.version)
# Load our commands from file # Load our commands from file
self.data['commands'] = self.load_from_file("commands") self.data["commands"] = self.load_from_file("commands")
## ##
# Mopidy is shutting down # Mopidy is shutting down
@ -869,27 +869,27 @@ class IrisCore(pykka.ThreadingActor):
## ##
def get_pinned(self, *args, **kwargs): def get_pinned(self, *args, **kwargs):
return self.get_data('pinned', *args, **kwargs) return self.get_data("pinned", *args, **kwargs)
def set_pinned(self, *args, **kwargs): def set_pinned(self, *args, **kwargs):
return self.set_data('pinned', *args, **kwargs) return self.set_data("pinned", *args, **kwargs)
## ##
# Commands # Commands
## ##
def get_commands(self, *args, **kwargs): def get_commands(self, *args, **kwargs):
return self.get_data('commands', *args, **kwargs) return self.get_data("commands", *args, **kwargs)
def set_commands(self, *args, **kwargs): def set_commands(self, *args, **kwargs):
return self.set_data('commands', *args, **kwargs) return self.set_data("commands", *args, **kwargs)
async def run_command(self, *args, **kwargs): async def run_command(self, *args, **kwargs):
callback = kwargs.get("callback", False) callback = kwargs.get("callback", False)
data = kwargs.get("data", {}) data = kwargs.get("data", {})
error = False error = False
if str(data["id"]) not in self.data['commands']: if str(data["id"]) not in self.data["commands"]:
error = { error = {
"message": "Command failed", "message": "Command failed",
"description": "Could not find command by ID " "description": "Could not find command by ID "
@ -898,7 +898,7 @@ class IrisCore(pykka.ThreadingActor):
+ '"', + '"',
} }
else: else:
command = self.data['commands'][str(data["id"])] command = self.data["commands"][str(data["id"])]
if "method" not in command: if "method" not in command:
error = { error = {
"message": "Command failed", "message": "Command failed",