diff options
Diffstat (limited to 'github3')
-rw-r--r-- | github3/handlers/base.py | 6 | ||||
-rw-r--r-- | github3/handlers/users.py | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/github3/handlers/base.py b/github3/handlers/base.py index 4e9198f..a85ce20 100644 --- a/github3/handlers/base.py +++ b/github3/handlers/base.py @@ -11,6 +11,12 @@ class Handler(object): self._gh = gh super(Handler, self).__init__() + def _inject_handler(self, handler, prefix=''): + import inspect + for method, callback in inspect.getmembers(handler): + if method.startswith(prefix) and inspect.ismethod(callback): + setattr(self, method, callback) + def _prefix_resource(self, resource): prefix = getattr(self, 'prefix', '') return '/'.join((prefix, str(resource))).strip('/') diff --git a/github3/handlers/users.py b/github3/handlers/users.py index 08c6171..4a181c8 100644 --- a/github3/handlers/users.py +++ b/github3/handlers/users.py @@ -78,7 +78,7 @@ class User(Handler): limit=limit) def get_watched(self, user=None, limit=None): - """ Return repositories that user whatch + """ Return repositories that user watch :param `user`: User model or username string |