public
Description: Python interface for talking to the github API
Clone URL: git://github.com/dustin/py-github.git
Added support for integer data types on elements.

These are used in the new (to me) forks and watchers, which is now
tested.
dustin (author)
Sat May 24 12:03:32 -0700 2008
commit  1f9c99aeb941e3cc59e4db9ec56b15f248ec3412
tree    4160ff5b8c377559a5c89d006c16913a0723f6a3
parent  c8f81c50830fa0c17fcba1a0ce3f331d5760ee95
...
3
4
5
 
6
7
8
9
 
 
10
11
 
12
13
14
15
 
 
16
17
 
18
19
20
21
 
 
22
23
 
24
25
26
27
 
 
28
29
 
30
31
32
33
 
 
34
35
 
36
37
38
39
 
 
40
41
 
42
43
44
45
 
 
46
47
 
48
49
50
51
 
 
52
53
 
54
55
56
57
 
 
58
59
 
60
61
62
63
 
 
64
65
 
66
67
68
69
 
 
70
71
 
72
73
74
75
 
 
76
77
 
78
79
80
81
 
 
82
83
 
84
85
86
87
 
 
88
89
 
90
91
92
93
 
 
94
95
 
96
97
98
99
 
 
100
101
 
102
103
104
105
 
 
106
107
 
108
109
110
111
 
 
112
113
 
114
115
116
117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
119
120
...
3
4
5
6
7
8
 
9
10
11
12
13
14
15
16
 
17
18
19
20
21
22
23
24
 
 
25
26
27
28
29
30
31
 
32
33
34
35
36
37
38
39
 
40
41
42
43
44
45
46
47
 
48
49
50
51
52
53
54
55
 
 
56
57
58
59
60
61
62
 
63
64
65
66
67
68
69
70
 
 
71
72
73
74
75
76
77
 
 
78
79
80
81
82
83
84
 
85
86
87
88
89
90
91
92
 
93
94
95
96
97
98
99
100
 
101
102
103
104
105
106
107
108
 
109
110
111
112
113
114
115
116
 
117
118
119
120
121
122
123
124
 
125
126
127
128
129
130
131
132
 
133
134
135
136
137
138
139
140
 
141
142
143
144
145
146
147
148
 
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
0
@@ -3,118 +3,264 @@
0
   <name>Dustin Sallings</name>
0
   <repositories type="array">
0
     <repository>
0
+ <description>A simple, asynchronous, single-threaded memcached client written in java.</description>
0
       <name>java-memcached-client</name>
0
       <url>http://github.com/dustin/java-memcached-client</url>
0
- <description>A simple, asynchronous, single-threaded memcached client written in java.</description>
0
       <homepage>http://code.google.com/p/spymemcached/</homepage>
0
+ <forks type="integer">3</forks>
0
+ <watchers type="integer">10</watchers>
0
     </repository>
0
     <repository>
0
+ <description>A buildbot GUI for OS X</description>
0
       <name>buildwatch</name>
0
       <url>http://github.com/dustin/buildwatch</url>
0
- <description>A buildbot GUI for OS X</description>
0
       <homepage>http://code.google.com/p/buildwatch/</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">3</watchers>
0
     </repository>
0
     <repository>
0
+ <description>A ruby client for freebase</description>
0
       <name>ruby-freebase</name>
0
       <url>http://github.com/dustin/ruby-freebase</url>
0
- <description>A ruby client for freebase</description>
0
- <homepage></homepage>
0
+ <forks type="integer">1</forks>
0
+ <watchers type="integer">5</watchers>
0
     </repository>
0
     <repository>
0
+ <description>My photo album project.</description>
0
       <name>photo</name>
0
       <url>http://github.com/dustin/photo</url>
0
- <description>My photo album project.</description>
0
       <homepage>http://bleu.west.spy.net/photo/</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
     </repository>
0
     <repository>
0
+ <description>A Gitk-like application written in RubyCocoa that looks like it belongs on a Mac. See the wiki for downloads and screenshots.</description>
0
       <name>gitnub</name>
0
       <url>http://github.com/dustin/gitnub</url>
0
- <description>A Gitk-like application written in RubyCocoa that looks like it belongs on a Mac. See the wiki for downloads and screenshots.</description>
0
       <homepage>http://alternateidea.com</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">3</watchers>
0
     </repository>
0
     <repository>
0
+ <description>Everyone's favorite memcached plugin for ActiveRecord.</description>
0
       <name>cache_fu</name>
0
       <url>http://github.com/dustin/cache_fu</url>
0
- <description>Everyone's favorite memcached plugin for ActiveRecord.</description>
0
       <homepage>http://errtheblog.com</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
     </repository>
0
     <repository>
0
+ <description>My money tracking app. There are many like it, but this one is mine.</description>
0
       <name>money</name>
0
       <url>http://github.com/dustin/money</url>
0
- <description>My money tracking app. There are many like it, but this one is mine.</description>
0
- <homepage></homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">5</watchers>
0
     </repository>
0
     <repository>
0
+ <description>Grit is a Ruby library for extracting information from a git repository in an object oriented manner.</description>
0
       <name>grit</name>
0
       <url>http://github.com/dustin/grit</url>
0
- <description>Grit is a Ruby library for extracting information from a git repository in an object oriented manner.</description>
0
       <homepage>http://grit.rubyforge.org/</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
     </repository>
0
     <repository>
0
+ <description>Combines several compressed web logfiles (including S3) into a single common log file very quickly.</description>
0
       <name>logmerge</name>
0
       <url>http://github.com/dustin/logmerge</url>
0
- <description>Combines several compressed web logfiles (including S3) into a single common log file very quickly.</description>
0
- <homepage></homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
     </repository>
0
     <repository>
0
+ <description>My environmental monitoring stuff for the house.</description>
0
       <name>environ</name>
0
       <url>http://github.com/dustin/environ</url>
0
- <description>My environmental monitoring stuff for the house.</description>
0
- <homepage></homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">2</watchers>
0
     </repository>
0
     <repository>
0
+ <description>My 1wire protocol stack and related tools</description>
0
       <name>ibutton</name>
0
       <url>http://github.com/dustin/ibutton</url>
0
- <description>My 1wire protocol stack and related tools</description>
0
       <homepage>http://bleu.west.spy.net/~dustin/projects/ibutton/</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
     </repository>
0
     <repository>
0
+ <description>OS X app that helps you focus by hiding applications you aren't paying attention to.</description>
0
       <name>app-hider</name>
0
       <url>http://github.com/dustin/app-hider</url>
0
- <description>OS X app that helps you focus by hiding applications you aren't paying attention to.</description>
0
       <homepage>http://bleu.west.spy.net/~dustin/projects/AppHider/</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">2</watchers>
0
     </repository>
0
     <repository>
0
+ <description>Python interface to backpack.</description>
0
       <name>py-backpack</name>
0
       <url>http://github.com/dustin/py-backpack</url>
0
- <description>Python interface to backpack.</description>
0
       <homepage>http://bleu.west.spy.net/~dustin/projects/backpack/</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">3</watchers>
0
     </repository>
0
     <repository>
0
+ <description>An OS X application to build a standalone web site as an export from my photo album.</description>
0
       <name>photosync</name>
0
       <url>http://github.com/dustin/photosync</url>
0
- <description>An OS X application to build a standalone web site as an export from my photo album.</description>
0
       <homepage>http://bleu.west.spy.net/~dustin/projects/photosync/</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
     </repository>
0
     <repository>
0
+ <description>My digg interface for java.</description>
0
       <name>java-digg</name>
0
       <url>http://github.com/dustin/java-digg</url>
0
- <description>My digg interface for java.</description>
0
       <homepage>http://bleu.west.spy.net/~dustin/projects/digg/</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
     </repository>
0
     <repository>
0
+ <description>My diggwatch site.</description>
0
       <name>diggwatch</name>
0
       <url>http://github.com/dustin/diggwatch</url>
0
- <description>My diggwatch site.</description>
0
       <homepage>http://bleu.west.spy.net/diggwatch/</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
     </repository>
0
     <repository>
0
+ <description>My generally useful java library I take wherever I go.</description>
0
       <name>spyjar</name>
0
       <url>http://github.com/dustin/spyjar</url>
0
- <description>My generally useful java library I take wherever I go.</description>
0
       <homepage>http://bleu.west.spy.net/~dustin/projects/spyjar/</homepage>
0
+ <forks type="integer">1</forks>
0
+ <watchers type="integer">2</watchers>
0
     </repository>
0
     <repository>
0
+ <description>A Mac OS X photo uploader program for my photo album.</description>
0
       <name>photoupload</name>
0
       <url>http://github.com/dustin/photoupload</url>
0
- <description>A Mac OS X photo uploader program for my photo album.</description>
0
       <homepage>http://bleu.west.spy.net/~dustin/projects/photoupload/</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
     </repository>
0
     <repository>
0
+ <description>Sinatra app that pushes your Github Commit info to twitter</description>
0
       <name>github-twitter</name>
0
       <url>http://github.com/dustin/github-twitter</url>
0
- <description>Sinatra app that pushes your Github Commit info to twitter</description>
0
       <homepage>http://groups.google.com/group/github-twitter/</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
+ </repository>
0
+ <repository>
0
+ <description>Python interface for talking to the github API</description>
0
+ <name>py-github</name>
0
+ <url>http://github.com/dustin/py-github</url>
0
+ <forks type="integer">2</forks>
0
+ <watchers type="integer">10</watchers>
0
+ </repository>
0
+ <repository>
0
+ <description>Slightly higher than low-level interface to GAE.</description>
0
+ <name>gae-base</name>
0
+ <url>http://github.com/dustin/gae-base</url>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">2</watchers>
0
+ </repository>
0
+ <repository>
0
+ <description>My OS X Thermometer client.</description>
0
+ <name>osx-thermometer</name>
0
+ <url>http://github.com/dustin/osx-thermometer</url>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
+ </repository>
0
+ <repository>
0
+ <description>Python memcached binary protocol client and server (used primarily for testing and protocol experimentation).</description>
0
+ <name>memcached-test</name>
0
+ <url>http://github.com/dustin/memcached-test</url>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
+ </repository>
0
+ <repository>
0
+ <description>A simple OS X program that keeps shell commands running.</description>
0
+ <name>loginit</name>
0
+ <url>http://github.com/dustin/loginit</url>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
+ </repository>
0
+ <repository>
0
+ <description>Plug and play trend visualisation for your data.</description>
0
+ <name>poormans-trends</name>
0
+ <url>http://github.com/dustin/poormans-trends</url>
0
+ <homepage>http://blog.choonkeat.com/weblog/2008/04/poor-mans-trend.html</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
+ </repository>
0
+ <repository>
0
+ <description>An Erlang client library for beanstalkd</description>
0
+ <name>erlang-beanstalk</name>
0
+ <url>http://github.com/dustin/erlang-beanstalk</url>
0
+ <homepage>http://tfletcher.com/dev/erlang-beanstalk</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">2</watchers>
0
+ </repository>
0
+ <repository>
0
+ <description>This is where my memcached work lives before svn munges the changes.</description>
0
+ <name>memcached</name>
0
+ <url>http://github.com/dustin/memcached</url>
0
+ <homepage>http://www.danga.com/memcached/</homepage>
0
+ <forks type="integer">1</forks>
0
+ <watchers type="integer">7</watchers>
0
+ </repository>
0
+ <repository>
0
+ <description>GitHub mirror of the publicly available git repo, updated hourly. It's here so we can use the collaboration tools of GitHub. Updates ONLY from git public repo. If you want changes pulled, contact the git team, not me.</description>
0
+ <name>git</name>
0
+ <url>http://github.com/dustin/git</url>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
+ </repository>
0
+ <repository>
0
+ <description>Keith Rarick's ruby client for beanstalk</description>
0
+ <name>beanstalk-client-ruby</name>
0
+ <url>http://github.com/dustin/beanstalk-client-ruby</url>
0
+ <homepage>http://xph.us/software/beanstalkd/</homepage>
0
+ <forks type="integer">1</forks>
0
+ <watchers type="integer">4</watchers>
0
+ </repository>
0
+ <repository>
0
+ <description>Annotate ActiveRecord models as a gem</description>
0
+ <name>annotate_models</name>
0
+ <url>http://github.com/dustin/annotate_models</url>
0
+ <homepage>http://agilewebdevelopment.com/plugins/annotate_models</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">2</watchers>
0
+ </repository>
0
+ <repository>
0
+ <description>Next Vista for Learning</description>
0
+ <name>nextvista</name>
0
+ <url>http://github.com/dustin/nextvista</url>
0
+ <homepage>http://www.nextvista.org/</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
+ </repository>
0
+ <repository>
0
+ <description>CruiseControl.rb is a continuous integration tool, written in Ruby. It is quick to install, simple to use and easy to hack.</description>
0
+ <name>cruisecontrolrb</name>
0
+ <url>http://github.com/dustin/cruisecontrolrb</url>
0
+ <homepage>http://cruisecontrolrb.thoughtworks.com/</homepage>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
+ </repository>
0
+ <repository>
0
+ <description>This is a webhook that allows github pushes to trigger builds through cruisecontrol.rb</description>
0
+ <name>cruisecontrolrb-webhook</name>
0
+ <url>http://github.com/dustin/cruisecontrolrb-webhook</url>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">2</watchers>
0
+ </repository>
0
+ <repository>
0
+ <description>My junk drawer. Various things I've played with in various states.</description>
0
+ <name>snippets</name>
0
+ <url>http://github.com/dustin/snippets</url>
0
+ <forks type="integer">0</forks>
0
+ <watchers type="integer">1</watchers>
0
     </repository>
0
   </repositories>
0
   <login>dustin</login>
...
44
45
46
47
 
 
 
 
 
 
 
48
49
50
...
44
45
46
 
47
48
49
50
51
52
53
54
55
56
0
@@ -44,7 +44,13 @@ class Repository(object):
0
         ch=el.firstChild
0
         while ch:
0
             if ch.nodeType != xml.dom.Node.TEXT_NODE and ch.firstChild:
0
- self.__dict__[ch.localName] = ch.firstChild.data
0
+ type = 'string'
0
+ if ch.attributes.has_key('type'):
0
+ type = ch.attributes['type'].value
0
+ if type == 'integer':
0
+ self.__dict__[ch.localName] = int(ch.firstChild.data)
0
+ else:
0
+ self.__dict__[ch.localName] = ch.firstChild.data
0
             ch=ch.nextSibling
0
 
0
     def __repr__(self):
...
38
39
40
41
 
42
43
44
45
46
 
47
48
49
...
54
55
56
 
 
 
 
 
 
 
 
 
 
57
58
59
...
38
39
40
 
41
42
43
44
45
 
46
47
48
49
...
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
0
@@ -38,12 +38,12 @@ class GitHubTest(unittest.TestCase):
0
         self.assertEquals("dustin", u.login)
0
         self.assertEquals("dustin@spy.net", u.email)
0
         self.assertEquals("Santa Clara, CA", u.location)
0
- self.assertEquals("<<User dustin with 19 repos>>", repr(u))
0
+ self.assertEquals("<<User dustin with 34 repos>>", repr(u))
0
 
0
     def testUserRepos(self):
0
         """Test the repositories within the user object."""
0
         u=self.__loadUser()
0
- self.assertEquals(19, len(u.repos))
0
+ self.assertEquals(34, len(u.repos))
0
         self.assertEquals('buildwatch', u.repos['buildwatch'].name)
0
         self.assertEquals('http://github.com/dustin/buildwatch',
0
             u.repos['buildwatch'].url)
0
@@ -54,6 +54,16 @@ class GitHubTest(unittest.TestCase):
0
         self.assertEquals("<<Repository buildwatch>>",
0
             repr(u.repos['buildwatch']))
0
 
0
+ def testUserWatchers(self):
0
+ """Test the watchers element in the user response."""
0
+ u=self.__loadUser()
0
+ self.assertEquals(10, u.repos['java-memcached-client'].watchers)
0
+
0
+ def testUserForks(self):
0
+ """Test the forks element in the user response."""
0
+ u=self.__loadUser()
0
+ self.assertEquals(3, u.repos['java-memcached-client'].forks)
0
+
0
     def testCommitsBase(self):
0
         commits=self.__loadCommits()
0
         self.assertEquals(30, len(commits))

Comments

    No one has commented yet.