| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent be44602 commit a469af8
29 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ | |||
| 4 | 4 | # This module is part of GitPython and is released under | |
| 5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 6 | 6 | # flake8: noqa | |
| 7 | - | ||
| 7 | + #@PydevCodeAnalysisIgnore | ||
| 8 | 8 | import os | |
| 9 | 9 | import sys | |
| 10 | 10 | import inspect | |
@@ -32,17 +32,17 @@ def _init_externals(): | |||
| 32 | 32 | ||
| 33 | 33 | #{ Imports | |
| 34 | 34 | ||
| 35 | - from git.config import GitConfigParser | ||
| 36 | - from git.objects import * | ||
| 37 | - from git.refs import * | ||
| 38 | - from git.diff import * | ||
| 39 | - from git.exc import * | ||
| 40 | - from git.db import * | ||
| 41 | - from git.cmd import Git | ||
| 42 | - from git.repo import Repo | ||
| 43 | - from git.remote import * | ||
| 44 | - from git.index import * | ||
| 45 | - from git.util import ( | ||
| 35 | + from git.config import GitConfigParser # @NoMove @IgnorePep8 | ||
| 36 | + from git.objects import * # @NoMove @IgnorePep8 | ||
| 37 | + from git.refs import * # @NoMove @IgnorePep8 | ||
| 38 | + from git.diff import * # @NoMove @IgnorePep8 | ||
| 39 | + from git.exc import * # @NoMove @IgnorePep8 | ||
| 40 | + from git.db import * # @NoMove @IgnorePep8 | ||
| 41 | + from git.cmd import Git # @NoMove @IgnorePep8 | ||
| 42 | + from git.repo import Repo # @NoMove @IgnorePep8 | ||
| 43 | + from git.remote import * # @NoMove @IgnorePep8 | ||
| 44 | + from git.index import * # @NoMove @IgnorePep8 | ||
| 45 | + from git.util import ( # @NoMove @IgnorePep8 | ||
| 46 | 46 | LockFile, | |
| 47 | 47 | BlockingLockFile, | |
| 48 | 48 | Stats, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,14 +13,14 @@ | |||
| 13 | 13 | ||
| 14 | 14 | from gitdb.utils.compat import ( | |
| 15 | 15 | xrange, | |
| 16 | - MAXSIZE, | ||
| 17 | - izip, | ||
| 16 | + MAXSIZE, # @UnusedImport | ||
| 17 | + izip, # @UnusedImport | ||
| 18 | 18 | ) | |
| 19 | 19 | from gitdb.utils.encoding import ( | |
| 20 | - string_types, | ||
| 21 | - text_type, | ||
| 22 | - force_bytes, | ||
| 23 | - force_text | ||
| 20 | + string_types, # @UnusedImport | ||
| 21 | + text_type, # @UnusedImport | ||
| 22 | + force_bytes, # @UnusedImport | ||
| 23 | + force_text # @UnusedImport | ||
| 24 | 24 | ) | |
| 25 | 25 | ||
| 26 | 26 | ||
@@ -33,17 +33,21 @@ | |||
| 33 | 33 | if PY3: | |
| 34 | 34 | import io | |
| 35 | 35 | FileType = io.IOBase | |
| 36 | + | ||
| 36 | 37 | def byte_ord(b): | |
| 37 | 38 | return b | |
| 39 | + | ||
| 38 | 40 | def bchr(n): | |
| 39 | 41 | return bytes([n]) | |
| 42 | + | ||
| 40 | 43 | def mviter(d): | |
| 41 | 44 | return d.values() | |
| 42 | - range = xrange | ||
| 45 | + | ||
| 46 | + range = xrange # @ReservedAssignment | ||
| 43 | 47 | unicode = str | |
| 44 | 48 | binary_type = bytes | |
| 45 | 49 | else: | |
| 46 | - FileType = file | ||
| 50 | + FileType = file # @UndefinedVariable on PY3 | ||
| 47 | 51 | # usually, this is just ascii, which might not enough for our encoding needs | |
| 48 | 52 | # Unless it's set specifically, we override it to be utf-8 | |
| 49 | 53 | if defenc == 'ascii': | |
@@ -52,7 +56,8 @@ def mviter(d): | |||
| 52 | 56 | bchr = chr | |
| 53 | 57 | unicode = unicode | |
| 54 | 58 | binary_type = str | |
| 55 | - range = xrange | ||
| 59 | + range = xrange # @ReservedAssignment | ||
| 60 | + | ||
| 56 | 61 | def mviter(d): | |
| 57 | 62 | return d.itervalues() | |
| 58 | 63 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,7 +40,7 @@ | |||
| 40 | 40 | class MetaParserBuilder(abc.ABCMeta): | |
| 41 | 41 | ||
| 42 | 42 | """Utlity class wrapping base-class methods into decorators that assure read-only properties""" | |
| 43 | - def __new__(metacls, name, bases, clsdict): | ||
| 43 | + def __new__(cls, name, bases, clsdict): | ||
| 44 | 44 | """ | |
| 45 | 45 | Equip all base-class methods with a needs_values decorator, and all non-const methods | |
| 46 | 46 | with a set_dirty_and_flush_changes decorator in addition to that.""" | |
@@ -62,7 +62,7 @@ def __new__(metacls, name, bases, clsdict): | |||
| 62 | 62 | # END for each base | |
| 63 | 63 | # END if mutating methods configuration is set | |
| 64 | 64 | ||
| 65 | - new_type = super(MetaParserBuilder, metacls).__new__(metacls, name, bases, clsdict) | ||
| 65 | + new_type = super(MetaParserBuilder, cls).__new__(cls, name, bases, clsdict) | ||
| 66 | 66 | return new_type | |
| 67 | 67 | ||
| 68 | 68 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ | |||
| 7 | 7 | bin_to_hex, | |
| 8 | 8 | hex_to_bin | |
| 9 | 9 | ) | |
| 10 | - from gitdb.db import GitDB | ||
| 10 | + from gitdb.db import GitDB # @UnusedImport | ||
| 11 | 11 | from gitdb.db import LooseObjectDB | |
| 12 | 12 | ||
| 13 | 13 | from .exc import ( | |
@@ -54,7 +54,7 @@ def partial_to_complete_sha_hex(self, partial_hexsha): | |||
| 54 | 54 | :note: currently we only raise BadObject as git does not communicate | |
| 55 | 55 | AmbiguousObjects separately""" | |
| 56 | 56 | try: | |
| 57 | - hexsha, typename, size = self._git.get_object_header(partial_hexsha) | ||
| 57 | + hexsha, typename, size = self._git.get_object_header(partial_hexsha) # @UnusedVariable | ||
| 58 | 58 | return hex_to_bin(hexsha) | |
| 59 | 59 | except (GitCommandError, ValueError): | |
| 60 | 60 | raise BadObject(partial_hexsha) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ | |||
| 5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 6 | 6 | """ Module containing all exceptions thrown througout the git package, """ | |
| 7 | 7 | ||
| 8 | - from gitdb.exc import * # NOQA | ||
| 8 | + from gitdb.exc import * # NOQA @UnusedWildImport | ||
| 9 | 9 | from git.compat import UnicodeMixin, safe_decode, string_types | |
| 10 | 10 | ||
| 11 | 11 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -170,7 +170,7 @@ def _delete_entries_cache(self): | |||
| 170 | 170 | ||
| 171 | 171 | def _deserialize(self, stream): | |
| 172 | 172 | """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 | ||
| 174 | 174 | return self | |
| 175 | 175 | ||
| 176 | 176 | def _entries_sorted(self): | |
@@ -404,7 +404,7 @@ def raise_exc(e): | |||
| 404 | 404 | continue | |
| 405 | 405 | # END glob handling | |
| 406 | 406 | try: | |
| 407 | - for root, dirs, files in os.walk(abs_path, onerror=raise_exc): | ||
| 407 | + for root, dirs, files in os.walk(abs_path, onerror=raise_exc): # @UnusedVariable | ||
| 408 | 408 | for rela_file in files: | |
| 409 | 409 | # add relative paths only | |
| 410 | 410 | yield os.path.join(root.replace(rs, ''), rela_file) | |
@@ -599,7 +599,6 @@ def _store_path(self, filepath, fprogress): | |||
| 599 | 599 | """Store file at filepath in the database and return the base index entry | |
| 600 | 600 | Needs the git_working_dir decorator active ! This must be assured in the calling code""" | |
| 601 | 601 | st = os.lstat(filepath) # handles non-symlinks as well | |
| 602 | - stream = None | ||
| 603 | 602 | if S_ISLNK(st.st_mode): | |
| 604 | 603 | # in PY3, readlink is string, but we need bytes. In PY2, it's just OS encoded bytes, we assume UTF-8 | |
| 605 | 604 | open_stream = lambda: BytesIO(force_bytes(os.readlink(filepath), encoding=defenc)) | |
@@ -1102,11 +1101,11 @@ def handle_stderr(proc, iter_checked_out_files): | |||
| 1102 | 1101 | try: | |
| 1103 | 1102 | self.entries[(co_path, 0)] | |
| 1104 | 1103 | except KeyError: | |
| 1105 | - dir = co_path | ||
| 1106 | - if not dir.endswith('/'): | ||
| 1107 | - dir += '/' | ||
| 1104 | + folder = co_path | ||
| 1105 | + if not folder.endswith('/'): | ||
| 1106 | + folder += '/' | ||
| 1108 | 1107 | for entry in mviter(self.entries): | |
| 1109 | - if entry.path.startswith(dir): | ||
| 1108 | + if entry.path.startswith(folder): | ||
| 1110 | 1109 | p = entry.path | |
| 1111 | 1110 | self._write_path_to_stdin(proc, p, p, make_exc, | |
| 1112 | 1111 | fprogress, read_from_stdout=False) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -264,7 +264,7 @@ def write_tree_from_cache(entries, odb, sl, si=0): | |||
| 264 | 264 | ||
| 265 | 265 | # enter recursion | |
| 266 | 266 | # 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 | ||
| 268 | 268 | tree_items_append((sha, S_IFDIR, base)) | |
| 269 | 269 | ||
| 270 | 270 | # skip ahead | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,22 +3,24 @@ | |||
| 3 | 3 | """ | |
| 4 | 4 | # flake8: noqa | |
| 5 | 5 | from __future__ import absolute_import | |
| 6 | + | ||
| 6 | 7 | import inspect | |
| 8 | + | ||
| 7 | 9 | from .base import * | |
| 10 | + from .blob import * | ||
| 11 | + from .commit import * | ||
| 12 | + from .submodule import util as smutil | ||
| 13 | + from .submodule.base import * | ||
| 14 | + from .submodule.root import * | ||
| 15 | + from .tag import * | ||
| 16 | + from .tree import * | ||
| 8 | 17 | # Fix import dependency - add IndexObject to the util module, so that it can be | |
| 9 | 18 | # imported by the submodule.base | |
| 10 | - from .submodule import util as smutil | ||
| 11 | 19 | smutil.IndexObject = IndexObject | |
| 12 | 20 | smutil.Object = Object | |
| 13 | 21 | del(smutil) | |
| 14 | - from .submodule.base import * | ||
| 15 | - from .submodule.root import * | ||
| 16 | 22 | ||
| 17 | 23 | # must come after submodule was made available | |
| 18 | - from .tag import * | ||
| 19 | - from .blob import * | ||
| 20 | - from .commit import * | ||
| 21 | - from .tree import * | ||
| 22 | 24 | ||
| 23 | 25 | __all__ = [name for name, obj in locals().items() | |
| 24 | 26 | if not (name.startswith('_') or inspect.ismodule(obj))] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,7 +40,7 @@ def __init__(self, repo, binsha): | |||
| 40 | 40 | assert len(binsha) == 20, "Require 20 byte binary sha, got %r, len = %i" % (binsha, len(binsha)) | |
| 41 | 41 | ||
| 42 | 42 | @classmethod | |
| 43 | - def new(cls, repo, id): | ||
| 43 | + def new(cls, repo, id): # @ReservedAssignment | ||
| 44 | 44 | """ | |
| 45 | 45 | :return: New Object instance of a type appropriate to the object type behind | |
| 46 | 46 | id. The id of the newly created object will be a binsha even though | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -140,7 +140,7 @@ def _get_intermediate_items(cls, commit): | |||
| 140 | 140 | def _set_cache_(self, attr): | |
| 141 | 141 | if attr in Commit.__slots__: | |
| 142 | 142 | # 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 | ||
| 144 | 144 | self._deserialize(BytesIO(stream.read())) | |
| 145 | 145 | else: | |
| 146 | 146 | super(Commit, self)._set_cache_(attr) | |
@@ -267,7 +267,7 @@ def _iter_from_process_or_stream(cls, repo, proc_or_stream): | |||
| 267 | 267 | hexsha = line.strip() | |
| 268 | 268 | if len(hexsha) > 40: | |
| 269 | 269 | # split additional information, as returned by bisect for instance | |
| 270 | - hexsha, rest = line.split(None, 1) | ||
| 270 | + hexsha, _ = line.split(None, 1) | ||
| 271 | 271 | # END handle extra info | |
| 272 | 272 | ||
| 273 | 273 | assert len(hexsha) == 40, "Invalid line: %s" % hexsha | |
| Back | FazBrowse Home | New Git URL |
0 commit comments