#
# $Copyright (C) 2012 Jose A. Rivera <jarrpa@redhat.com>$
#
-# $Date: 2012-05-24 16:22:04 -0500 UTC$
+# $Date: 2012-05-31 15:36:03 -0500$
#
# ---------------------------------------------------------------------------- #
#
from datetime import datetime, timedelta, tzinfo
-def git(args):
+def git(args, interactive=False):
if type(args) == str:
tmp = args.split('"')
tmp2 = []
tmp2 = tmp2 + tmp[i].split()
args = tmp2
args = ['git'] + args
- git = subprocess.Popen(args, stdout=subprocess.PIPE)
- details = git.stdout.read()
- details = details.strip()
+ if not interactive:
+ out = subprocess.PIPE
+ sh = False
+ else:
+ out = None
+ sh = True
+ git = subprocess.Popen(args, stdout=out)
+ if not interactive:
+ details = git.stdout.read()
+ details = details.strip()
+ else:
+ git.wait()
+ details = None
return details
def git_config(key):