Skip to content

Commit b64c771

Browse files
committed
Fixed all applicable lint issues
1 parent 37393af commit b64c771

26 files changed

+76
-82
lines changed

gitdb/db/base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from itertools import chain
2323
from functools import reduce
2424

25-
import sys
2625

2726

2827
__all__ = ('ObjectDBR', 'ObjectDBW', 'FileDBBase', 'CompoundDB', 'CachingDB')
@@ -206,7 +205,6 @@ def _databases_recursive(database, output):
206205
"""Fill output list with database from db, in order. Deals with Loose, Packed
207206
and compound databases."""
208207
if isinstance(database, CompoundDB):
209-
compounds = list()
210208
dbs = database.databases()
211209
output.extend(db for db in dbs if not isinstance(db, CompoundDB))
212210
for cdb in (db for db in dbs if isinstance(db, CompoundDB)):

gitdb/db/git.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@
1212
from gitdb.db.pack import PackedDB
1313
from gitdb.db.ref import ReferenceDB
1414

15-
from gitdb.util import LazyMixin
16-
from gitdb.exc import (
17-
InvalidDBRoot,
18-
BadObject,
19-
AmbiguousObjectName
20-
)
15+
from gitdb.exc import InvalidDBRoot
2116

2217
import os
2318

gitdb/db/loose.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
from gitdb.exc import (
13-
InvalidDBRoot,
1413
BadObject,
1514
AmbiguousObjectName
1615
)
@@ -55,8 +54,6 @@
5554
from gitdb.utils.encoding import force_bytes
5655

5756
import tempfile
58-
import mmap
59-
import sys
6057
import os
6158

6259

@@ -149,11 +146,6 @@ def _map_loose_object(self, sha):
149146
raise BadObject(sha)
150147
# END handle error
151148
# END exception handling
152-
try:
153-
return mmap.mmap(fd, 0, access=mmap.ACCESS_READ)
154-
finally:
155-
os.close(fd)
156-
# END assure file is closed
157149

158150
def set_ostream(self, stream):
159151
""":raise TypeError: if the stream does not support the Sha1Writer interface"""

gitdb/db/pack.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ def stream(self, sha):
103103
return entity.stream_at_index(index)
104104

105105
def sha_iter(self):
106-
sha_list = list()
107106
for entity in self.entities():
108107
index = entity.index()
109108
sha_by_index = index.sha

gitdb/db/ref.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
CompoundDB,
77
)
88

9-
import os
109
__all__ = ('ReferenceDB', )
1110

1211
class ReferenceDB(CompoundDB):

gitdb/ext/smmap

Submodule smmap updated from f53ddc6 to 28fd45e

gitdb/fun.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,15 @@
66
Keeping this code separate from the beginning makes it easier to out-source
77
it into c later, if required"""
88

9-
from gitdb.exc import (
10-
BadObjectType
11-
)
12-
139
import zlib
1410
from gitdb.util import byte_ord
1511
decompressobj = zlib.decompressobj
1612

1713
import mmap
1814
from itertools import islice
15+
from functools import reduce
1916

20-
from gitdb.utils.compat import izip
17+
from gitdb.utils.compat import izip, buffer, xrange
2118
from gitdb.typ import (
2219
str_blob_type,
2320
str_commit_type,
@@ -247,7 +244,6 @@ def compress(self):
247244
if slen < 2:
248245
return self
249246
i = 0
250-
slen_orig = slen
251247

252248
first_data_index = None
253249
while i < slen:
@@ -399,7 +395,6 @@ def loose_object_header_info(m):
399395
object as well as its uncompressed size in bytes.
400396
:param m: memory map from which to read the compressed object data"""
401397
from gitdb.const import NULL_BYTE
402-
from gitdb.utils.encoding import force_text
403398

404399
decompress_size = 8192 # is used in cgit as well
405400
hdr = decompressobj().decompress(m, decompress_size)
@@ -684,7 +679,7 @@ def is_equal_canonical_sha(canonical_length, match, sha1):
684679

685680

686681
try:
687-
# raise ImportError; # DEBUG
682+
# NOQA
688683
from _perf import connect_deltas
689684
except ImportError:
690685
pass

gitdb/pack.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from gitdb.exc import (
99
BadObject,
10+
AmbiguousObjectName,
1011
UnsupportedOperation,
1112
ParseError
1213
)
@@ -57,11 +58,7 @@
5758
FlexibleSha1Writer
5859
)
5960

60-
from struct import (
61-
pack,
62-
unpack,
63-
)
64-
61+
from struct import pack
6562
from binascii import crc32
6663

6764
from gitdb.const import NULL_BYTE

gitdb/stream.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
# This module is part of GitDB and is released under
44
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
55

6-
from io import BytesIO, StringIO
6+
from io import BytesIO
77

8-
import errno
98
import mmap
109
import os
1110
import zlib
@@ -15,7 +14,6 @@
1514
stream_copy,
1615
apply_delta_data,
1716
connect_deltas,
18-
DeltaChunkList,
1917
delta_types
2018
)
2119

gitdb/test/db/lib.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
from gitdb.test.lib import (
77
with_rw_directory,
88
with_packs_rw,
9-
ZippedStoreShaWriter,
109
fixture_path,
1110
TestBase
1211
)
1312

14-
from gitdb.stream import Sha1Writer
13+
14+
15+
from gitdb.stream import (
16+
Sha1Writer,
17+
ZippedStoreShaWriter
18+
)
1519

1620
from gitdb.base import (
1721
IStream,

0 commit comments

Comments
 (0)