| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,6 @@ | |||
| 22 | 22 | from itertools import chain | |
| 23 | 23 | from functools import reduce | |
| 24 | 24 | ||
| 25 | - import sys | ||
| 26 | 25 | ||
| 27 | 26 | ||
| 28 | 27 | __all__ = ('ObjectDBR', 'ObjectDBW', 'FileDBBase', 'CompoundDB', 'CachingDB') | |
@@ -206,7 +205,6 @@ def _databases_recursive(database, output): | |||
| 206 | 205 | """Fill output list with database from db, in order. Deals with Loose, Packed | |
| 207 | 206 | and compound databases.""" | |
| 208 | 207 | if isinstance(database, CompoundDB): | |
| 209 | - compounds = list() | ||
| 210 | 208 | dbs = database.databases() | |
| 211 | 209 | output.extend(db for db in dbs if not isinstance(db, CompoundDB)) | |
| 212 | 210 | for cdb in (db for db in dbs if isinstance(db, CompoundDB)): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,12 +12,7 @@ | |||
| 12 | 12 | from gitdb.db.pack import PackedDB | |
| 13 | 13 | from gitdb.db.ref import ReferenceDB | |
| 14 | 14 | ||
| 15 | - from gitdb.util import LazyMixin | ||
| 16 | - from gitdb.exc import ( | ||
| 17 | - InvalidDBRoot, | ||
| 18 | - BadObject, | ||
| 19 | - AmbiguousObjectName | ||
| 20 | - ) | ||
| 15 | + from gitdb.exc import InvalidDBRoot | ||
| 21 | 16 | ||
| 22 | 17 | import os | |
| 23 | 18 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,7 +10,6 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | from gitdb.exc import ( | |
| 13 | - InvalidDBRoot, | ||
| 14 | 13 | BadObject, | |
| 15 | 14 | AmbiguousObjectName | |
| 16 | 15 | ) | |
@@ -55,8 +54,6 @@ | |||
| 55 | 54 | from gitdb.utils.encoding import force_bytes | |
| 56 | 55 | ||
| 57 | 56 | import tempfile | |
| 58 | - import mmap | ||
| 59 | - import sys | ||
| 60 | 57 | import os | |
| 61 | 58 | ||
| 62 | 59 | ||
@@ -149,11 +146,6 @@ def _map_loose_object(self, sha): | |||
| 149 | 146 | raise BadObject(sha) | |
| 150 | 147 | # END handle error | |
| 151 | 148 | # 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 | ||
| 157 | 149 | ||
| 158 | 150 | def set_ostream(self, stream): | |
| 159 | 151 | """:raise TypeError: if the stream does not support the Sha1Writer interface""" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -103,7 +103,6 @@ def stream(self, sha): | |||
| 103 | 103 | return entity.stream_at_index(index) | |
| 104 | 104 | ||
| 105 | 105 | def sha_iter(self): | |
| 106 | - sha_list = list() | ||
| 107 | 106 | for entity in self.entities(): | |
| 108 | 107 | index = entity.index() | |
| 109 | 108 | sha_by_index = index.sha | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,7 +6,6 @@ | |||
| 6 | 6 | CompoundDB, | |
| 7 | 7 | ) | |
| 8 | 8 | ||
| 9 | - import os | ||
| 10 | 9 | __all__ = ('ReferenceDB', ) | |
| 11 | 10 | ||
| 12 | 11 | class ReferenceDB(CompoundDB): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,18 +6,15 @@ | |||
| 6 | 6 | Keeping this code separate from the beginning makes it easier to out-source | |
| 7 | 7 | it into c later, if required""" | |
| 8 | 8 | ||
| 9 | - from gitdb.exc import ( | ||
| 10 | - BadObjectType | ||
| 11 | - ) | ||
| 12 | - | ||
| 13 | 9 | import zlib | |
| 14 | 10 | from gitdb.util import byte_ord | |
| 15 | 11 | decompressobj = zlib.decompressobj | |
| 16 | 12 | ||
| 17 | 13 | import mmap | |
| 18 | 14 | from itertools import islice | |
| 15 | + from functools import reduce | ||
| 19 | 16 | ||
| 20 | - from gitdb.utils.compat import izip | ||
| 17 | + from gitdb.utils.compat import izip, buffer, xrange | ||
| 21 | 18 | from gitdb.typ import ( | |
| 22 | 19 | str_blob_type, | |
| 23 | 20 | str_commit_type, | |
@@ -247,7 +244,6 @@ def compress(self): | |||
| 247 | 244 | if slen < 2: | |
| 248 | 245 | return self | |
| 249 | 246 | i = 0 | |
| 250 | - slen_orig = slen | ||
| 251 | 247 | ||
| 252 | 248 | first_data_index = None | |
| 253 | 249 | while i < slen: | |
@@ -399,7 +395,6 @@ def loose_object_header_info(m): | |||
| 399 | 395 | object as well as its uncompressed size in bytes. | |
| 400 | 396 | :param m: memory map from which to read the compressed object data""" | |
| 401 | 397 | from gitdb.const import NULL_BYTE | |
| 402 | - from gitdb.utils.encoding import force_text | ||
| 403 | 398 | ||
| 404 | 399 | decompress_size = 8192 # is used in cgit as well | |
| 405 | 400 | hdr = decompressobj().decompress(m, decompress_size) | |
@@ -684,7 +679,7 @@ def is_equal_canonical_sha(canonical_length, match, sha1): | |||
| 684 | 679 | ||
| 685 | 680 | ||
| 686 | 681 | try: | |
| 687 | - # raise ImportError; # DEBUG | ||
| 682 | + # NOQA | ||
| 688 | 683 | from _perf import connect_deltas | |
| 689 | 684 | except ImportError: | |
| 690 | 685 | pass | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,6 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | 8 | from gitdb.exc import ( | |
| 9 | 9 | BadObject, | |
| 10 | + AmbiguousObjectName, | ||
| 10 | 11 | UnsupportedOperation, | |
| 11 | 12 | ParseError | |
| 12 | 13 | ) | |
@@ -57,11 +58,7 @@ | |||
| 57 | 58 | FlexibleSha1Writer | |
| 58 | 59 | ) | |
| 59 | 60 | ||
| 60 | - from struct import ( | ||
| 61 | - pack, | ||
| 62 | - unpack, | ||
| 63 | - ) | ||
| 64 | - | ||
| 61 | + from struct import pack | ||
| 65 | 62 | from binascii import crc32 | |
| 66 | 63 | ||
| 67 | 64 | from gitdb.const import NULL_BYTE | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,9 +3,8 @@ | |||
| 3 | 3 | # This module is part of GitDB and is released under | |
| 4 | 4 | # the New BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 5 | 5 | ||
| 6 | - from io import BytesIO, StringIO | ||
| 6 | + from io import BytesIO | ||
| 7 | 7 | ||
| 8 | - import errno | ||
| 9 | 8 | import mmap | |
| 10 | 9 | import os | |
| 11 | 10 | import zlib | |
@@ -15,7 +14,6 @@ | |||
| 15 | 14 | stream_copy, | |
| 16 | 15 | apply_delta_data, | |
| 17 | 16 | connect_deltas, | |
| 18 | - DeltaChunkList, | ||
| 19 | 17 | delta_types | |
| 20 | 18 | ) | |
| 21 | 19 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,12 +6,16 @@ | |||
| 6 | 6 | from gitdb.test.lib import ( | |
| 7 | 7 | with_rw_directory, | |
| 8 | 8 | with_packs_rw, | |
| 9 | - ZippedStoreShaWriter, | ||
| 10 | 9 | fixture_path, | |
| 11 | 10 | TestBase | |
| 12 | 11 | ) | |
| 13 | 12 | ||
| 14 | - from gitdb.stream import Sha1Writer | ||
| 13 | + | ||
| 14 | + | ||
| 15 | + from gitdb.stream import ( | ||
| 16 | + Sha1Writer, | ||
| 17 | + ZippedStoreShaWriter | ||
| 18 | + ) | ||
| 15 | 19 | ||
| 16 | 20 | from gitdb.base import ( | |
| 17 | 21 | IStream, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments