Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Added method 'add_signal' to CallbackRegistry #381

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
2011-06-24 Added 'add_signal' to the CallbackRegistry. - BVR

2011-06-16 Added *bottom* keyword parameter for the stem command.
Also, implemented a legend handler for the stem plot.
- JJL
Expand Down
10 changes: 10 additions & 0 deletions lib/matplotlib/cbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,16 @@ def _check_signal(self, s):
signals.sort()
raise ValueError('Unknown signal "%s"; valid signals are %s'%(s, signals))

def add_signal(self, s) :
"""
Add another valid signal *s* to the registry.
If the signal already exists, no change is made.
"""
if s not in self.signals :
self.signals.add(s)
self.callbacks[s] = dict()


def connect(self, s, func):
"""
register *func* to be called when a signal *s* is generated
Expand Down