From 4c852c3b9d05d8dad3325923d6f6885c17b15b91 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 15 Aug 2010 06:38:48 -0400 Subject: [PATCH] Support listing watched repositories of given username. --- github2/repositories.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/github2/repositories.py b/github2/repositories.py index 5486e31..362a32d 100644 --- a/github2/repositories.py +++ b/github2/repositories.py @@ -91,3 +91,10 @@ class Repositories(GithubCommand): def branches(self, project): return self.make_request("show", project, "branches", filter="branches") + + def watching(self, for_user=None): + """Lists all the repos a user is watching.""" + for_user = for_user or self.request.username + return self.get_values("watched", for_user, filter="repositories", + datatype=Repository) +