Skip to content

Commit

Permalink
Further work of python git interface
Browse files Browse the repository at this point in the history
  • Loading branch information
István Bozsó committed Feb 13, 2020
1 parent f577447 commit 9d77f77
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
29 changes: 26 additions & 3 deletions tools/git.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import utils
from tools import github, bitbucket
from tools import home, github, bitbucket

cd = utils.cd

commands = (
"add", "am", "annotate", "apply", "archive", "bisect", "blame",
Expand All @@ -26,13 +28,34 @@
}


class Git(object):
class Git(cd):
default_user = "bozso"

tpl =

__slots__ = (
"path",
)

def __init__(self, repo_path):
self.path = repo_path
cd.__init__(self, repo_path)

def __enter__(self):
cd.__enter__(self)

return self

def report(self, repo):
pass


def main():
pass
for repo, path in repos.items():

with Git(path) as g:
print(git.push().decode("utf-8"))


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion utils/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def subcommands(root, *args, **kwargs):
return type(root, (object,),
{
cmd: staticmethod(
Command.with_parser("%s %s" % (root, cmd), p)
Command("%s %s" % (root, cmd), p)
)
for cmd in args
}
Expand Down

0 comments on commit 9d77f77

Please sign in to comment.