Skip to content

Conversation

@mfine
Copy link
Contributor

@mfine mfine commented Jun 19, 2015

Check to see if the msg_type is a list, and then apply the callbacks to all the message types. Better way to do something like this?

/cc @fnoble @denniszollo

@swiftnav-jenkins
Copy link
Contributor

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
http://zazu.ci.swiftnav.com/job/libsbp_Pull_Requests/143/
Test PASSed.

Copy link
Contributor

Choose a reason for hiding this comment

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

This could be generalized to all iterables. The most "pythonic" way to check if something is an iterable is just to assume it is and catch failure:

try:
  for mt in msg_type:
    self.callbacks[mt].add(callback)
except TypeError:
  self.callbacks[msg_type].add(callback)

http://stackoverflow.com/questions/1952464/in-python-how-do-i-determine-if-an-object-is-iterable

@swiftnav-jenkins
Copy link
Contributor

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
http://zazu.ci.swiftnav.com/job/libsbp_Pull_Requests/144/
Test PASSed.

@mfine
Copy link
Contributor Author

mfine commented Jun 19, 2015

Moved to iterable and added some tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

Still a "List" here

Copy link
Contributor

Choose a reason for hiding this comment

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

But maybe that more instructive?

@denniszollo
Copy link
Contributor

Love it

@fnoble
Copy link
Contributor

fnoble commented Jun 19, 2015

lgtm

@swiftnav-jenkins
Copy link
Contributor

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
http://zazu.ci.swiftnav.com/job/libsbp_Pull_Requests/145/
Test PASSed.

@mfine
Copy link
Contributor Author

mfine commented Jun 19, 2015

Fixed the docs. Bringing in.

mfine added a commit that referenced this pull request Jun 19, 2015
Make add and remove callbacks take lists of message for convenience
@mfine mfine merged commit dee2566 into swift-nav:master Jun 19, 2015
@mfine mfine deleted the mfine-callback-lists branch June 19, 2015 19:05
@swiftnav-jenkins
Copy link
Contributor

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
http://zazu.ci.swiftnav.com/job/libsbp_Pull_Requests/146/
Test PASSed.

RReichert pushed a commit that referenced this pull request May 15, 2024
…1412)

Automated PR by Jenkins. If CI has passed successfully, merge away!



**cmake**  117b3f73  ->  68306be8
-  68306be8  :  ASIO gRPC boost container fix (swift-nav/cmake#174)


This pull request was created by
https://jenkins.ci.swift-nav.com/job/CI%20Infra/job/submodule-update/17362/.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants