mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
some small improvements
This commit is contained in:
parent
f90fdc0627
commit
8ff0731aa5
3 changed files with 16 additions and 6 deletions
|
@ -66,7 +66,7 @@
|
||||||
alchemy_easy = ["sqlalchemy", "psycopg2_binary"]
|
alchemy_easy = ["sqlalchemy", "psycopg2_binary"]
|
||||||
alchemy_hard = ["sqlalchemy", "psycopg2"]
|
alchemy_hard = ["sqlalchemy", "psycopg2"]
|
||||||
bard = ["ffmpeg_python", "youtube_dl"]
|
bard = ["ffmpeg_python", "youtube_dl"]
|
||||||
constellation = ["starlette", "uvicorn"]
|
constellation = ["starlette", "uvicorn", "python-multipart"]
|
||||||
sentry = ["sentry_sdk"]
|
sentry = ["sentry_sdk"]
|
||||||
herald = ["websockets"]
|
herald = ["websockets"]
|
||||||
coloredlogs = ["coloredlogs"]
|
coloredlogs = ["coloredlogs"]
|
||||||
|
|
|
@ -15,15 +15,25 @@ class Event:
|
||||||
self.interface: CommandInterface = interface
|
self.interface: CommandInterface = interface
|
||||||
"""The :class:`CommandInterface` available to this :class:`Event`."""
|
"""The :class:`CommandInterface` available to this :class:`Event`."""
|
||||||
|
|
||||||
|
@property
|
||||||
|
def serf(self):
|
||||||
|
"""A shortcut for :attr:`.interface.serf`."""
|
||||||
|
return self.interface.serf
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def alchemy(self):
|
def alchemy(self):
|
||||||
"""A shortcut for :attr:`.interface.serf.alchemy`."""
|
"""A shortcut for :attr:`.interface.alchemy`."""
|
||||||
return self.interface.serf.alchemy
|
return self.interface.alchemy
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def loop(self):
|
def loop(self):
|
||||||
"""A shortcut for :attr:`.interface.serf.loop`"""
|
"""A shortcut for :attr:`.interface.loop`."""
|
||||||
return self.interface.serf.loop
|
return self.interface.loop
|
||||||
|
|
||||||
|
@property
|
||||||
|
def config(self):
|
||||||
|
"""A shortcut for :attr:`.interface.config`."""
|
||||||
|
return self.interface.config
|
||||||
|
|
||||||
async def run(self, **kwargs):
|
async def run(self, **kwargs):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
|
@ -166,7 +166,7 @@ class Serf:
|
||||||
response: rh.Response = await self.herald.request(destination=destination, request=request)
|
response: rh.Response = await self.herald.request(destination=destination, request=request)
|
||||||
if isinstance(response, rh.ResponseFailure):
|
if isinstance(response, rh.ResponseFailure):
|
||||||
if response.name == "no_event":
|
if response.name == "no_event":
|
||||||
raise CommandError(f"There is no event named {event_name} in {destination}.")
|
raise ProgramError(f"There is no event named {event_name} in {destination}.")
|
||||||
elif response.name == "error_in_event":
|
elif response.name == "error_in_event":
|
||||||
if response.extra_info["type"] == "CommandError":
|
if response.extra_info["type"] == "CommandError":
|
||||||
raise CommandError(response.extra_info["message"])
|
raise CommandError(response.extra_info["message"])
|
||||||
|
|
Loading…
Reference in a new issue