From 277be842bf30848e7292a931169bd4c8ff726dee Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sun, 1 Jun 2008 12:58:32 -0700 Subject: style: follow PEP 8 in git/cmd.py Keyword args shouldn't use spaces around the equals sign per PEP 8. Signed-off-by: David Aguilar --- lib/git/cmd.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/git/cmd.py') diff --git a/lib/git/cmd.py b/lib/git/cmd.py index ac449e91..8c996070 100644 --- a/lib/git/cmd.py +++ b/lib/git/cmd.py @@ -51,11 +51,11 @@ class Git(MethodMissingMixin): return self.git_dir def execute(self, command, - istream = None, - with_status = False, - with_stderr = False, - with_exceptions = False, - with_raw_output = False, + istream=None, + with_status=False, + with_stderr=False, + with_exceptions=False, + with_raw_output=False, ): """ Handles executing the command on the shell and consumes and returns @@ -96,10 +96,10 @@ class Git(MethodMissingMixin): # Start the process proc = subprocess.Popen(command, - cwd = self.git_dir, - stdin = istream, - stderr = stderr, - stdout = subprocess.PIPE + cwd=self.git_dir, + stdin=istream, + stderr=stderr, + stdout=subprocess.PIPE ) # Wait for the process to return -- cgit v1.2.1 From edf9fc528277a53ec37d1bd79fb4f8608cce11ae Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sat, 31 May 2008 23:01:17 -0700 Subject: Git: guard against passing False to git commands git does not accept commands of the form: git cmd --xx=False or git cmd -xFalse This patch prevents transform_kwargs from producing command lines with those values. This adds some flexibility/syntactic sugar for callers since they can then assume that kwargs with a False value are not passed to git commands. Signed-off-by: David Aguilar --- lib/git/cmd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/git/cmd.py') diff --git a/lib/git/cmd.py b/lib/git/cmd.py index 8c996070..afa13e2c 100644 --- a/lib/git/cmd.py +++ b/lib/git/cmd.py @@ -132,12 +132,12 @@ class Git(MethodMissingMixin): if len(k) == 1: if v is True: args.append("-%s" % k) - else: + elif type(v) is not bool: args.append("-%s%s" % (k, v)) else: if v is True: args.append("--%s" % dashify(k)) - else: + elif type(v) is not bool: args.append("--%s=%s" % (dashify(k), v)) return args -- cgit v1.2.1