Black cleanup
This commit is contained in:
@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user