Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1234a10

Browse files
committed
Merge branch 'autopep' into 0.3
Resolvesgitpython-developers#182
2 parents4d9b7b0 +2572647 commit1234a10

Some content is hidden

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

48 files changed

+814
-668
lines changed

‎git/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def _init_externals():
2020
importgitdb
2121
exceptImportError:
2222
raiseImportError("'gitdb' could not be found in your PYTHONPATH")
23-
#END verify import
23+
#END verify import
2424

2525
#} END initialization
2626

@@ -41,13 +41,13 @@ def _init_externals():
4141
fromgit.remoteimport*
4242
fromgit.indeximport*
4343
fromgit.utilimport (
44-
LockFile,
45-
BlockingLockFile,
46-
Stats,
47-
Actor
48-
)
44+
LockFile,
45+
BlockingLockFile,
46+
Stats,
47+
Actor
48+
)
4949

5050
#} END imports
5151

5252
__all__= [nameforname,objinlocals().items()
53-
ifnot (name.startswith('_')orinspect.ismodule(obj))]
53+
ifnot (name.startswith('_')orinspect.ismodule(obj))]

‎git/cmd.py

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

7-
importos,sys
7+
importos
8+
importsys
89
fromutilimport (
9-
LazyMixin,
10-
stream_copy
11-
)
10+
LazyMixin,
11+
stream_copy
12+
)
1213
fromexcimportGitCommandError
1314

1415
fromsubprocessimport (
15-
call,
16-
Popen,
17-
PIPE
18-
)
16+
call,
17+
Popen,
18+
PIPE
19+
)
1920

2021
execute_kwargs= ('istream','with_keep_cwd','with_extended_output',
2122
'with_exceptions','as_process',
@@ -29,6 +30,7 @@ def dashify(string):
2930

3031

3132
classGit(LazyMixin):
33+
3234
"""
3335
The Git class manages communication with the Git binary.
3436
@@ -246,7 +248,7 @@ def _set_cache_(self, attr):
246248
self._version_info=tuple(int(n)forninversion_numbers.split('.')[:4]ifn.isdigit())
247249
else:
248250
super(Git,self)._set_cache_(attr)
249-
#END handle version info
251+
#END handle version info
250252

251253
@property
252254
defworking_dir(self):
@@ -336,25 +338,25 @@ def execute(self, command,
336338

337339
# Allow the user to have the command executed in their working dir.
338340
ifwith_keep_cwdorself._working_dirisNone:
339-
cwd=os.getcwd()
341+
cwd=os.getcwd()
340342
else:
341-
cwd=self._working_dir
343+
cwd=self._working_dir
342344

343345
# Start the process
344346
env=os.environ.copy()
345347
env["LC_MESSAGES"]="C"
346348
proc=Popen(command,
347-
env=env,
348-
cwd=cwd,
349-
stdin=istream,
350-
stderr=PIPE,
351-
stdout=PIPE,
352-
# Prevent cmd prompt popups on windows by using a shell ... .
353-
# See https://github.com/gitpython-developers/GitPython/pull/126
354-
shell=sys.platform=='win32',
355-
close_fds=(os.name=='posix'),# unsupported on linux
356-
**subprocess_kwargs
357-
)
349+
env=env,
350+
cwd=cwd,
351+
stdin=istream,
352+
stderr=PIPE,
353+
stdout=PIPE,
354+
# Prevent cmd prompt popups on windows by using a shell ... .
355+
# See https://github.com/gitpython-developers/GitPython/pull/126
356+
shell=sys.platform=='win32',
357+
close_fds=(os.name=='posix'),# unsupported on linux
358+
**subprocess_kwargs
359+
)
358360
ifas_process:
359361
returnself.AutoInterrupt(proc,command)
360362

@@ -508,7 +510,7 @@ def make_call():
508510
call.extend([dashify(method)])
509511
call.extend(args)
510512
returncall
511-
#END utility to recreate call after changes
513+
#END utility to recreate call after changes
512514

513515
ifsys.platform=='win32':
514516
try:
@@ -518,7 +520,7 @@ def make_call():
518520
# did we switch to git.cmd already, or was it changed from default ? permanently fail
519521
ifself.GIT_PYTHON_GIT_EXECUTABLE!=self.git_exec_name:
520522
raise
521-
#END handle overridden variable
523+
#END handle overridden variable
522524
type(self).GIT_PYTHON_GIT_EXECUTABLE=self.git_exec_name_win
523525
call= [self.GIT_PYTHON_GIT_EXECUTABLE]+list(args)
524526

@@ -529,14 +531,14 @@ def make_call():
529531
msg="WARNING: Automatically switched to use git.cmd as git executable, which reduces performance by ~70%."
530532
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
531533
warnings.warn(msg)
532-
#END print of warning
533-
#END catch first failure
534+
#END print of warning
535+
#END catch first failure
534536
exceptWindowsError:
535537
raiseWindowsError("The system cannot find or execute the file at %r"%self.GIT_PYTHON_GIT_EXECUTABLE)
536-
#END provide better error message
538+
#END provide better error message
537539
else:
538540
returnself.execute(make_call(),**_kwargs)
539-
#END handle windows default installation
541+
#END handle windows default installation
540542

541543
def_parse_object_header(self,header_line):
542544
"""

‎git/config.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class SectionConstraint(object):
8080
It supports all ConfigParser methods that operate on an option"""
8181
__slots__= ("_config","_section_name")
8282
_valid_attrs_= ("get_value","set_value","get","set","getint","getfloat","getboolean","has_option",
83-
"remove_section","remove_option","options")
83+
"remove_section","remove_option","options")
8484

8585
def__init__(self,config,section):
8686
self._config=config
@@ -136,7 +136,7 @@ class GitConfigParser(cp.RawConfigParser, object):
136136
# (either : or =), followed
137137
# by any # space/tab
138138
r'(?P<value>.*)$'# everything up to eol
139-
)
139+
)
140140

141141
# list of RawConfigParser methods able to change the instance
142142
_mutating_methods_= ("add_section","remove_section","remove_option","set")
@@ -165,7 +165,8 @@ def __init__(self, file_or_files, read_only=True):
165165

166166
ifnotread_only:
167167
ifisinstance(file_or_files, (tuple,list)):
168-
raiseValueError("Write-ConfigParsers can operate on a single file only, multiple files have been passed")
168+
raiseValueError(
169+
"Write-ConfigParsers can operate on a single file only, multiple files have been passed")
169170
# END single file check
170171

171172
ifnotisinstance(file_or_files,basestring):
@@ -338,7 +339,7 @@ def write(self):
338339
# make sure we do not overwrite into an existing file
339340
ifhasattr(fp,'truncate'):
340341
fp.truncate()
341-
#END
342+
#END
342343
# END handle stream or file
343344

344345
# WRITE DATA

‎git/db.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
"""Module with our own gitdb implementation - it uses the git command"""
22
fromexcimport (
3-
GitCommandError,
4-
BadObject
5-
)
3+
GitCommandError,
4+
BadObject
5+
)
66

77
fromgitdb.baseimport (
8-
OInfo,
9-
OStream
10-
)
8+
OInfo,
9+
OStream
10+
)
1111

1212
fromgitdb.utilimport (
13-
bin_to_hex,
14-
hex_to_bin
15-
)
13+
bin_to_hex,
14+
hex_to_bin
15+
)
1616
fromgitdb.dbimportGitDB
1717
fromgitdb.dbimportLooseObjectDB
1818

1919

2020
__all__= ('GitCmdObjectDB','GitDB')
2121

22-
#class GitCmdObjectDB(CompoundDB, ObjectDBW):
22+
#class GitCmdObjectDB(CompoundDB, ObjectDBW):
2323

2424

2525
classGitCmdObjectDB(LooseObjectDB):

‎git/diff.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ def _index_from_patch_format(cls, repo, stream):
308308
new_file,deleted_file=bool(new_file_mode),bool(deleted_file_mode)
309309

310310
index.append(Diff(repo,a_path,b_path,a_blob_id,b_blob_id,
311-
old_modeordeleted_file_mode,new_modeornew_file_modeorb_mode,
312-
new_file,deleted_file,rename_from,rename_to,diff[header.end():]))
311+
old_modeordeleted_file_mode,new_modeornew_file_modeorb_mode,
312+
new_file,deleted_file,rename_from,rename_to,diff[header.end():]))
313313

314314
returnindex
315315

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp