-
-
Notifications
You must be signed in to change notification settings - Fork 381
Adding comm_info_request and comm_info_reply messages #25
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
Conversation
|
||
# Should this be moved to ipkernel? | ||
if hasattr(self, 'comm_manager'): | ||
comm_list = self.comm_manager.comms.keys() |
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 will presumably need to be cast to a list.
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.
that's right. Python 3 sorry.
Done |
def comm_list_request(self, stream, ident, parent): | ||
content = parent['content'] | ||
|
||
# Should this be moved to ipkernel? |
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.
ipykernel? Actually, we should just answer the question now...
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.
I think that it is @minrk's call.
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.
I think this is a fine place for it.
1e26373
to
5dc4c7d
Compare
5dc4c7d
to
3a57345
Compare
Rebased to use the new schema for the Message type: ``comm_info_request``::
content = {
#optional, (filter by target name)
'target_name' : str,
}
Message type: ``comm_info_reply``::
content = {
# A dictionary of the comms, indexed by uuids.
'comms': {
comm_id: {
'target_name': str,
},
},
} |
3a57345
to
c9e1f5e
Compare
I added the ability to filter by target name as discussed earlier. |
thanks, @SylvainCorlay! |
I hesitated to give a list of target names rather than a single target name for the filter, but it would have been the only message having a list of target names, so it is probably more consistent with the rest of the messages to only allow one. |
@SylvainCorlay good choice. I don't imagine the use case for people wanting more than one but less than all is worth having the extra logic. |
def test_comm_info_request(): | ||
flush_channels() | ||
|
||
msg_id = KC.comm_info() |
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.
Can you add a if not hasattr(KC, 'comm_info'): raise SkipTest()
? Then this test will run while comm_info is defined, but skip while jupyter_client is < 4.1.
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.
Done!
(Done) |
@SylvainCorlay thanks! Now I think we can start getting this tested for those living on master. |
Adding comm_info_request and comm_info_reply messages
Adding a
comm_list_[request/reply]
shell message. This requires jupyter/jupyter_client#34.