~qzhang/bugdispatcher/init-gitshow

« back to all changes in this revision

Viewing changes to gitshow/git_operator.py

  • Committer: Spring Zhang
  • Date: 2011-04-18 17:36:38 UTC
  • Revision ID: spring.zhang@linaro.org-20110418173638-ai59g66kfh20v0jb
create a wrapper for python-git

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
from git import Repo, Git
 
4
 
 
5
class GitOperator:
 
6
    def __init__(self, path):
 
7
        self.repo = Repo(path)
 
8
        self.g = Git(path)
 
9
 
 
10
 
 
11
if __name__ == "__main__":
 
12
    go = GitOperator("/home/spring/linaro/git/u-boot")
 
13
    print go.repo.commits()
 
14
    print go.g.status()