public
Description: Python interface for talking to the github API
Clone URL: git://github.com/dustin/py-github.git
Separate sync with repo object from sync with URL.

I need to figure out how to get private repos in here without waiting
forever for them to be available from github itself.
dustin (author)
Tue May 13 00:55:51 -0700 2008
commit  58512e897889455da41dfdb9027d1c542f17f84e
tree    6f5dfeae880adefb495a4c99569a11c5cf74e17f
parent  bdb9461f2acc4a3f456cb6c9dfecbd02e909a084
...
11
12
13
14
15
16
 
 
 
17
18
19
20
21
22
23
 
 
 
24
25
26
...
37
38
39
40
 
...
11
12
13
 
 
 
14
15
16
17
 
18
19
20
21
22
23
24
25
26
27
28
...
39
40
41
 
42
0
@@ -11,16 +11,18 @@ import subprocess
0
 
0
 import github
0
 
0
-def sync(path, user, repo):
0
- p=os.path.join(path, repo.name) + ".git"
0
- print "Syncing %s -> %s" % (repo, p)
0
+def sync(path, url, repo_name):
0
+ p=os.path.join(path, repo_name) + ".git"
0
+ print "Syncing %s -> %s" % (repo_name, p)
0
     if not os.path.exists(p):
0
- url = "git://github.com/%s/%s" % (user.login, repo.name)
0
         subprocess.call(['git', 'clone', '--bare', url, p])
0
         subprocess.call(['git', '--git-dir=' + p, 'remote', 'add', '--mirror',
0
             'origin', url])
0
     subprocess.call(['git', '--git-dir=' + p, 'fetch', '-f'])
0
 
0
+def sync_user_repo(path, user, repo):
0
+ sync(path, "git://github.com/%s/%s" % (user.login, repo.name), repo.name)
0
+
0
 def usage():
0
     sys.stderr.write("Usage: %s username destination_url\n" % sys.argv[0])
0
     sys.stderr.write(
0
@@ -37,4 +39,4 @@ if __name__ == '__main__':
0
     u = gh.user(user)
0
 
0
     for repo in u.repos.values():
0
- sync(path, u, repo)
0
+ sync_user_repo(path, u, repo)

Comments

    No one has commented yet.