Skip to content
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

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Conversation

Rixxan
Copy link
Contributor

@Rixxan Rixxan commented Jun 6, 2022

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

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
@theunkn0wn1 theunkn0wn1 self-requested a review June 19, 2022 20:46
@theunkn0wn1 theunkn0wn1 added this to the v1.0 milestone Jun 19, 2022
Comment on lines +77 to +78
except asyncio.CancelledError:
pass
Copy link
Collaborator

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):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing return type annotation.

Comment on lines +63 to +67
self.all_channels = []
self._list_client = []
self._list_channel = []
self._list_count = []
self._list_topic = []
Copy link
Collaborator

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.

Comment on lines +71 to +73
await self.rawmsg("LIST")
future = asyncio.get_running_loop().create_future()
await self._list_query.put(future)
Copy link
Collaborator

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.

pydle/features/rfc1459/client.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add LIST support
2 participants