-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#166] Add LIST Support #172
base: develop
Are you sure you want to change the base?
Conversation
Allows users to call channel_list from the BasicClient, which returns a list containing the total LIST response from the server according to the IRC specification
except asyncio.CancelledError: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should likely propagate up the cancellation error, right now it unexpectedly returns None
from a function that should return a list[Channel]
(where Channel = str
, probably)
self._list_topic = [] | ||
self._list_query = asyncio.Queue() | ||
|
||
async def channel_list(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing return type annotation.
self.all_channels = [] | ||
self._list_client = [] | ||
self._list_channel = [] | ||
self._list_count = [] | ||
self._list_topic = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should get some type annotations.
await self.rawmsg("LIST") | ||
future = asyncio.get_running_loop().create_future() | ||
await self._list_query.put(future) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This future should be enqueued prior to emitting the LIST
command, to prevent a race.
Adds support for the LIST command (defined by RFC1459 Section 4.2.6) and adds a new function (BasicClient.channel_list). The channel_list function returns an updated channel listing of all channels and details of channels generated by the LIST command.
This differs from the existing BasicClient.channels, which only return channels that Pylde is currently in, or considers itself to already be in.
Resolves #166