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

Commitc7f459f

Browse files
committed
src: No PyDev warnings
+ Mark all unused vars and other non-pep8 (PyDev) warnings+ test_utils: + enable & fix forgotten IterableList looped path. + unittestize all assertions.
1 parentbe44602 commitc7f459f

20 files changed

+129
-119
lines changed

‎git/__init__.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66
# flake8: noqa
7-
7+
#@PydevCodeAnalysisIgnore
88
importos
99
importsys
1010
importinspect
@@ -32,17 +32,17 @@ def _init_externals():
3232

3333
#{ Imports
3434

35-
fromgit.configimportGitConfigParser
36-
fromgit.objectsimport*
37-
fromgit.refsimport*
38-
fromgit.diffimport*
39-
fromgit.excimport*
40-
fromgit.dbimport*
41-
fromgit.cmdimportGit
42-
fromgit.repoimportRepo
43-
fromgit.remoteimport*
44-
fromgit.indeximport*
45-
fromgit.utilimport (
35+
fromgit.configimportGitConfigParser# @NoMove @IgnorePep8
36+
fromgit.objectsimport*# @NoMove @IgnorePep8
37+
fromgit.refsimport*# @NoMove @IgnorePep8
38+
fromgit.diffimport*# @NoMove @IgnorePep8
39+
fromgit.excimport*# @NoMove @IgnorePep8
40+
fromgit.dbimport*# @NoMove @IgnorePep8
41+
fromgit.cmdimportGit# @NoMove @IgnorePep8
42+
fromgit.repoimportRepo# @NoMove @IgnorePep8
43+
fromgit.remoteimport*# @NoMove @IgnorePep8
44+
fromgit.indeximport*# @NoMove @IgnorePep8
45+
fromgit.utilimport (# @NoMove @IgnorePep8
4646
LockFile,
4747
BlockingLockFile,
4848
Stats,

‎git/index/base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def _delete_entries_cache(self):
170170

171171
def_deserialize(self,stream):
172172
"""Initialize this instance with index values read from the given stream"""
173-
self.version,self.entries,self._extension_data,conten_sha=read_cache(stream)
173+
self.version,self.entries,self._extension_data,conten_sha=read_cache(stream)# @UnusedVariable
174174
returnself
175175

176176
def_entries_sorted(self):
@@ -404,7 +404,7 @@ def raise_exc(e):
404404
continue
405405
# END glob handling
406406
try:
407-
forroot,dirs,filesinos.walk(abs_path,onerror=raise_exc):
407+
forroot,dirs,filesinos.walk(abs_path,onerror=raise_exc):# @UnusedVariable
408408
forrela_fileinfiles:
409409
# add relative paths only
410410
yieldos.path.join(root.replace(rs,''),rela_file)
@@ -599,7 +599,6 @@ def _store_path(self, filepath, fprogress):
599599
"""Store file at filepath in the database and return the base index entry
600600
Needs the git_working_dir decorator active ! This must be assured in the calling code"""
601601
st=os.lstat(filepath)# handles non-symlinks as well
602-
stream=None
603602
ifS_ISLNK(st.st_mode):
604603
# in PY3, readlink is string, but we need bytes. In PY2, it's just OS encoded bytes, we assume UTF-8
605604
open_stream=lambda:BytesIO(force_bytes(os.readlink(filepath),encoding=defenc))

‎git/index/fun.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def write_tree_from_cache(entries, odb, sl, si=0):
264264

265265
# enter recursion
266266
# ci - 1 as we want to count our current item as well
267-
sha,tree_entry_list=write_tree_from_cache(entries,odb,slice(ci-1,xi),rbound+1)
267+
sha,tree_entry_list=write_tree_from_cache(entries,odb,slice(ci-1,xi),rbound+1)# @UnusedVariable
268268
tree_items_append((sha,S_IFDIR,base))
269269

270270
# skip ahead

‎git/objects/__init__.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,24 @@
33
"""
44
# flake8: noqa
55
from __future__importabsolute_import
6+
67
importinspect
8+
79
from .baseimport*
10+
from .blobimport*
11+
from .commitimport*
12+
from .submoduleimportutilassmutil
13+
from .submodule.baseimport*
14+
from .submodule.rootimport*
15+
from .tagimport*
16+
from .treeimport*
817
# Fix import dependency - add IndexObject to the util module, so that it can be
918
# imported by the submodule.base
10-
from .submoduleimportutilassmutil
1119
smutil.IndexObject=IndexObject
1220
smutil.Object=Object
1321
del(smutil)
14-
from .submodule.baseimport*
15-
from .submodule.rootimport*
1622

1723
# must come after submodule was made available
18-
from .tagimport*
19-
from .blobimport*
20-
from .commitimport*
21-
from .treeimport*
2224

2325
__all__= [nameforname,objinlocals().items()
2426
ifnot (name.startswith('_')orinspect.ismodule(obj))]

‎git/objects/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __init__(self, repo, binsha):
4040
assertlen(binsha)==20,"Require 20 byte binary sha, got %r, len = %i"% (binsha,len(binsha))
4141

4242
@classmethod
43-
defnew(cls,repo,id):
43+
defnew(cls,repo,id):# @ReservedAssignment
4444
"""
4545
:return: New Object instance of a type appropriate to the object type behind
4646
id. The id of the newly created object will be a binsha even though

‎git/objects/commit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def _get_intermediate_items(cls, commit):
140140
def_set_cache_(self,attr):
141141
ifattrinCommit.__slots__:
142142
# read the data in a chunk, its faster - then provide a file wrapper
143-
binsha,typename,self.size,stream=self.repo.odb.stream(self.binsha)
143+
binsha,typename,self.size,stream=self.repo.odb.stream(self.binsha)# @UnusedVariable
144144
self._deserialize(BytesIO(stream.read()))
145145
else:
146146
super(Commit,self)._set_cache_(attr)
@@ -267,7 +267,7 @@ def _iter_from_process_or_stream(cls, repo, proc_or_stream):
267267
hexsha=line.strip()
268268
iflen(hexsha)>40:
269269
# split additional information, as returned by bisect for instance
270-
hexsha,rest=line.split(None,1)
270+
hexsha,_=line.split(None,1)
271271
# END handle extra info
272272

273273
assertlen(hexsha)==40,"Invalid line: %s"%hexsha

‎git/refs/reference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __str__(self):
5050

5151
#{ Interface
5252

53-
defset_object(self,object,logmsg=None):
53+
defset_object(self,object,logmsg=None):# @ReservedAssignment
5454
"""Special version which checks if the head-log needs an update as well
5555
:return: self"""
5656
oldbinsha=None

‎git/refs/symbolic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def set_commit(self, commit, logmsg=None):
218218

219219
returnself
220220

221-
defset_object(self,object,logmsg=None):
221+
defset_object(self,object,logmsg=None):# @ReservedAssignment
222222
"""Set the object we point to, possibly dereference our symbolic reference first.
223223
If the reference does not exist, it will be created
224224
@@ -229,7 +229,7 @@ def set_object(self, object, logmsg=None):
229229
:note: plain SymbolicReferences may not actually point to objects by convention
230230
:return: self"""
231231
ifisinstance(object,SymbolicReference):
232-
object=object.object
232+
object=object.object# @ReservedAssignment
233233
# END resolve references
234234

235235
is_detached=True

‎git/repo/fun.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def rev_parse(repo, rev):
284284
try:
285285
iftoken=="~":
286286
obj=to_commit(obj)
287-
foriteminxrange(num):
287+
for_inxrange(num):
288288
obj=obj.parents[0]
289289
# END for each history item to walk
290290
eliftoken=="^":

‎git/test/lib/asserts.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
importstat
99

1010
fromnose.toolsimport (
11-
assert_equal,
12-
assert_not_equal,
13-
assert_raises,
14-
raises,
15-
assert_true,
16-
assert_false
11+
assert_equal,# @UnusedImport
12+
assert_not_equal,# @UnusedImport
13+
assert_raises,# @UnusedImport
14+
raises,# @UnusedImport
15+
assert_true,# @UnusedImport
16+
assert_false# @UnusedImport
1717
)
1818

1919
try:
2020
fromunittest.mockimportpatch
2121
exceptImportError:
22-
frommockimportpatch
22+
frommockimportpatch# @NoMove @UnusedImport
2323

2424
__all__= ['assert_instance_of','assert_not_instance_of',
2525
'assert_none','assert_not_none',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp