Skip to content

Commit c8e7074

Browse files
committed
pep8 linting (trailing whitespace)
W291 trailing whitespace
1 parent bed3b09 commit c8e7074

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+673
-673
lines changed

‎git/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ def _init_externals():
4141
from git.remote import *
4242
from git.index import *
4343
from git.util import (
44-
LockFile,
45-
BlockingLockFile,
44+
LockFile,
45+
BlockingLockFile,
4646
Stats,
4747
Actor
4848
)

‎git/cmd.py

+40-40
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66

77
import os, sys
88
from util import (
9-
LazyMixin,
9+
LazyMixin,
1010
stream_copy
1111
)
1212
from exc import GitCommandError
1313

1414
from subprocess import (
15-
call,
15+
call,
1616
Popen,
1717
PIPE
1818
)
1919

2020
execute_kwargs = ('istream', 'with_keep_cwd', 'with_extended_output',
21-
'with_exceptions', 'as_process',
21+
'with_exceptions', 'as_process',
2222
'output_stream')
2323

2424
__all__ = ('Git', )
@@ -40,7 +40,7 @@ class Git(LazyMixin):
4040
rval = g.ls_files() # calls 'git ls-files' program
4141
4242
``Debugging``
43-
Set the GIT_PYTHON_TRACE environment variable print each invocation
43+
Set the GIT_PYTHON_TRACE environment variable print each invocation
4444
of the command to stdout.
4545
Set its value to 'full' to see details about the returned values.
4646
"""
@@ -63,7 +63,7 @@ class Git(LazyMixin):
6363

6464
class AutoInterrupt(object):
6565

66-
"""Kill/Interrupt the stored process instance once this instance goes out of scope. It is
66+
"""Kill/Interrupt the stored process instance once this instance goes out of scope. It is
6767
used to prevent processes piling up in case iterators stop reading.
6868
Besides all attributes are wired through to the contained process object.
6969
@@ -83,7 +83,7 @@ def __del__(self):
8383
if self.proc.poll() is not None:
8484
return
8585

86-
# can be that nothing really exists anymore ...
86+
# can be that nothing really exists anymore ...
8787
if os is None:
8888
return
8989

@@ -94,34 +94,34 @@ def __del__(self):
9494
except OSError:
9595
pass # ignore error when process already died
9696
except AttributeError:
97-
# try windows
98-
# for some reason, providing None for stdout/stderr still prints something. This is why
99-
# we simply use the shell and redirect to nul. Its slower than CreateProcess, question
97+
# try windows
98+
# for some reason, providing None for stdout/stderr still prints something. This is why
99+
# we simply use the shell and redirect to nul. Its slower than CreateProcess, question
100100
# is whether we really want to see all these messages. Its annoying no matter what.
101101
call(("TASKKILL /F /T /PID %s 2>nul 1>nul" % str(self.proc.pid)), shell=True)
102-
# END exception handling
102+
# END exception handling
103103

104104
def __getattr__(self, attr):
105105
return getattr(self.proc, attr)
106106

107107
def wait(self):
108-
"""Wait for the process and return its status code.
108+
"""Wait for the process and return its status code.
109109
110110
:raise GitCommandError: if the return status is not 0"""
111111
status = self.proc.wait()
112112
if status != 0:
113113
raise GitCommandError(self.args, status, self.proc.stderr.read())
114-
# END status handling
114+
# END status handling
115115
return status
116116
# END auto interrupt
117117

118118
class CatFileContentStream(object):
119119

120-
"""Object representing a sized read-only stream returning the contents of
120+
"""Object representing a sized read-only stream returning the contents of
121121
an object.
122-
It behaves like a stream, but counts the data read and simulates an empty
122+
It behaves like a stream, but counts the data read and simulates an empty
123123
stream once our sized content region is empty.
124-
If not all data is read to the end of the objects's lifetime, we read the
124+
If not all data is read to the end of the objects's lifetime, we read the
125125
rest to assure the underlying stream continues to work"""
126126

127127
__slots__ = ('_stream', '_nbr', '_size')
@@ -131,7 +131,7 @@ def __init__(self, size, stream):
131131
self._size = size
132132
self._nbr = 0 # num bytes read
133133

134-
# special case: if the object is empty, has null bytes, get the
134+
# special case: if the object is empty, has null bytes, get the
135135
# final newline right away.
136136
if size == 0:
137137
stream.read(1)
@@ -220,9 +220,9 @@ def __init__(self, working_dir=None):
220220
"""Initialize this instance with:
221221
222222
:param working_dir:
223-
Git directory we should work in. If None, we always work in the current
223+
Git directory we should work in. If None, we always work in the current
224224
directory as returned by os.getcwd().
225-
It is meant to be the working tree directory if available, or the
225+
It is meant to be the working tree directory if available, or the
226226
.git directory in case of bare repositories."""
227227
super(Git, self).__init__()
228228
self._working_dir = working_dir
@@ -233,7 +233,7 @@ def __init__(self, working_dir=None):
233233
self.cat_file_all = None
234234

235235
def __getattr__(self, name):
236-
"""A convenience method as it allows to call the command as if it was
236+
"""A convenience method as it allows to call the command as if it was
237237
an object.
238238
:return: Callable object that will execute call _call_process with your arguments."""
239239
if name[0] == '_':
@@ -267,8 +267,8 @@ def execute(self, command,
267267
with_keep_cwd=False,
268268
with_extended_output=False,
269269
with_exceptions=True,
270-
as_process=False,
271-
output_stream=None,
270+
as_process=False,
271+
output_stream=None,
272272
**subprocess_kwargs
273273
):
274274
"""Handles executing the command on the shell and consumes and returns
@@ -294,26 +294,26 @@ def execute(self, command,
294294
Whether to raise an exception when git returns a non-zero status.
295295
296296
:param as_process:
297-
Whether to return the created process instance directly from which
298-
streams can be read on demand. This will render with_extended_output and
299-
with_exceptions ineffective - the caller will have
297+
Whether to return the created process instance directly from which
298+
streams can be read on demand. This will render with_extended_output and
299+
with_exceptions ineffective - the caller will have
300300
to deal with the details himself.
301301
It is important to note that the process will be placed into an AutoInterrupt
302-
wrapper that will interrupt the process once it goes out of scope. If you
303-
use the command in iterators, you should pass the whole process instance
302+
wrapper that will interrupt the process once it goes out of scope. If you
303+
use the command in iterators, you should pass the whole process instance
304304
instead of a single stream.
305305
306306
:param output_stream:
307-
If set to a file-like object, data produced by the git command will be
307+
If set to a file-like object, data produced by the git command will be
308308
output to the given stream directly.
309309
This feature only has any effect if as_process is False. Processes will
310310
always be created with a pipe due to issues with subprocess.
311-
This merely is a workaround as data will be copied from the
311+
This merely is a workaround as data will be copied from the
312312
output pipe to the given output stream directly.
313313
314314
:param subprocess_kwargs:
315-
Keyword arguments to be passed to subprocess.Popen. Please note that
316-
some of the valid kwargs are already set by this method, the ones you
315+
Keyword arguments to be passed to subprocess.Popen. Please note that
316+
some of the valid kwargs are already set by this method, the ones you
317317
specify may not be the same ones.
318318
319319
:return:
@@ -330,7 +330,7 @@ def execute(self, command,
330330
:raise GitCommandError:
331331
332332
:note:
333-
If you add additional keyword arguments to the signature of this method,
333+
If you add additional keyword arguments to the signature of this method,
334334
you must update the execute_kwargs tuple housed in this module."""
335335
if self.GIT_PYTHON_TRACE and not self.GIT_PYTHON_TRACE == 'full':
336336
print ' '.join(command)
@@ -360,7 +360,7 @@ def execute(self, command,
360360
stderr_value = ''
361361
try:
362362
if output_stream is None:
363-
stdout_value, stderr_value = proc.communicate()
363+
stdout_value, stderr_value = proc.communicate()
364364
# strip trailing "\n"
365365
if stdout_value.endswith("\n"):
366366
stdout_value = stdout_value[:-1]
@@ -434,7 +434,7 @@ def __unpack_args(cls, arg_list):
434434
outlist.extend(cls.__unpack_args(arg))
435435
elif isinstance(arg_list, unicode):
436436
outlist.append(arg_list.encode('utf-8'))
437-
# END recursion
437+
# END recursion
438438
else:
439439
outlist.append(str(arg))
440440
# END for each arg
@@ -523,7 +523,7 @@ def make_call():
523523
finally:
524524
import warnings
525525
msg = "WARNING: Automatically switched to use git.cmd as git executable, which reduces performance by ~70%."
526-
msg += "Its recommended to put git.exe into the PATH or to set the %s environment variable to the executable's location" % self._git_exec_env_var
526+
msg += "Its recommended to put git.exe into the PATH or to set the %s environment variable to the executable's location" % self._git_exec_env_var
527527
warnings.warn(msg)
528528
#END print of warning
529529
#END catch first failure
@@ -541,7 +541,7 @@ def _parse_object_header(self, header_line):
541541
542542
:return: (hex_sha, type_string, size_as_int)
543543
544-
:raise ValueError: if the header contains indication for an error due to
544+
:raise ValueError: if the header contains indication for an error due to
545545
incorrect input sha"""
546546
tokens = header_line.split()
547547
if len(tokens) != 3:
@@ -553,7 +553,7 @@ def _parse_object_header(self, header_line):
553553
# END error handling
554554

555555
if len(tokens[0]) != 40:
556-
raise ValueError("Failed to parse header: %r" % header_line)
556+
raise ValueError("Failed to parse header: %r" % header_line)
557557
return (tokens[0], tokens[1], int(tokens[2]))
558558

559559
def __prepare_ref(self, ref):
@@ -581,11 +581,11 @@ def __get_object_header(self, cmd, ref):
581581
return self._parse_object_header(cmd.stdout.readline())
582582

583583
def get_object_header(self, ref):
584-
""" Use this method to quickly examine the type and size of the object behind
585-
the given ref.
584+
""" Use this method to quickly examine the type and size of the object behind
585+
the given ref.
586586
587-
:note: The method will only suffer from the costs of command invocation
588-
once and reuses the command in subsequent calls.
587+
:note: The method will only suffer from the costs of command invocation
588+
once and reuses the command in subsequent calls.
589589
590590
:return: (hexsha, type_string, size_as_int)"""
591591
cmd = self.__get_persistent_cmd("cat_file_header", "cat_file", batch_check=True)

0 commit comments

Comments
 (0)