Skip to content

Commit

Permalink
work on git management automation
Browse files Browse the repository at this point in the history
  • Loading branch information
Istvan Bozso committed Feb 13, 2020
1 parent f1341ca commit f577447
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 164 deletions.
70 changes: 0 additions & 70 deletions tools/base.py

This file was deleted.

38 changes: 38 additions & 0 deletions tools/git.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import utils
from tools import github, bitbucket

commands = (
"add", "am", "annotate", "apply", "archive", "bisect", "blame",
"branch", "bundle", "checkout", "cherry", "cherry-pick", "clean",
"clone", "commit", "config", "describe", "diff", "difftool",
"fetch", "filter-branch", "format-patch", "fsck", "gc",
"get-tar-commit-id", "grep", "help", "imap-send", "init",
"instaweb", "interpret-trailers", "log", "merge", "mergetool",
"mv", "name-rev", "notes", "pull", "push", "rebase", "reflog",
"remote", "repack", "replace", "request-pull", "reset",
"revert", "rm", "shortlog", "show", "show-branch", "stage",
"stash", "status", "submodule", "subtree", "tag", "verify-commit",
"whatchanged", "worktree",
)

git = utils.subcommands("git", *commands)

repos = {
"insar_meteo": github.join("insar_meteo"),
"geodynamics": github.join("geodynamics"),
"utils": github.join("utils"),
"texfiles": home.join("Dokumentumok", "texfiles"),
"pygamma": github.join("pygomma"),
}


class Git(object):
def report(self, repo):
pass


def main():
pass

if __name__ == "__main__":
main()
93 changes: 0 additions & 93 deletions tools/gpp.py

This file was deleted.

28 changes: 28 additions & 0 deletions tools/tools.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import utils

home = utils.Path.joined("/home", "istvan")
progs = home.join(home, "progs")
github = progs.join("github.com")
bitbucket = progs.join("bitbucket.org")


notify_send = utils.Command.with_parser("notify-send")

def notify(msg, header=None, icon=None, time=None):

if header is not None:
txt = '"%s" "%s"' % (header, msg)
else:
txt = msg

if icon is not None:
txt = '%s -i "%s"' % (txt, join(icons, icon))

if time is not None:
txt = "%s -t %s" % (txt, time)

return notify_send(txt)


def debug(msg):
notify(msg, header="Debug", icon="debug.png")
4 changes: 3 additions & 1 deletion utils/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ def subcommands(root, *args, **kwargs):

return type(root, (object,),
{
cmd: Command.with_parser("%s %s" % (root, cmd), p)
cmd: staticmethod(
Command.with_parser("%s %s" % (root, cmd), p)
)
for cmd in args
}
)

0 comments on commit f577447

Please sign in to comment.