From f5d11b750ecc982541d1f936488248f0b42d75d3 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sun, 16 Nov 2014 20:15:50 +0100 Subject: pep8 linting (whitespaces) W191 indentation contains tabs E221 multiple spaces before operator E222 multiple spaces after operator E225 missing whitespace around operator E271 multiple spaces after keyword W292 no newline at end of file W293 blank line contains whitespace W391 blank line at end of file --- git/db.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'git/db.py') diff --git a/git/db.py b/git/db.py index 8caa85f6..0d12aeb4 100644 --- a/git/db.py +++ b/git/db.py @@ -23,7 +23,7 @@ __all__ = ('GitCmdObjectDB', 'GitDB' ) class GitCmdObjectDB(LooseObjectDB): """A database representing the default git object store, which includes loose objects, pack files and an alternates file - + It will create objects only in the loose object database. :note: for now, we use the git command to do all the lookup, just until he have packs and the other implementations @@ -32,19 +32,19 @@ class GitCmdObjectDB(LooseObjectDB): """Initialize this instance with the root and a git command""" super(GitCmdObjectDB, self).__init__(root_path) self._git = git - + def info(self, sha): hexsha, typename, size = self._git.get_object_header(bin_to_hex(sha)) return OInfo(hex_to_bin(hexsha), typename, size) - + def stream(self, sha): """For now, all lookup is done by git itself""" hexsha, typename, size, stream = self._git.stream_object_data(bin_to_hex(sha)) return OStream(hex_to_bin(hexsha), typename, size, stream) - - + + # { Interface - + def partial_to_complete_sha_hex(self, partial_hexsha): """:return: Full binary 20 byte sha from the given partial hexsha :raise AmbiguousObjectName: @@ -57,5 +57,5 @@ class GitCmdObjectDB(LooseObjectDB): except (GitCommandError, ValueError): raise BadObject(partial_hexsha) # END handle exceptions - + #} END interface -- cgit v1.2.3 From be34ec23c48d6d5d8fd2ef4491981f6fb4bab8e6 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sun, 16 Nov 2014 20:51:04 +0100 Subject: pep8 linting (blank lines expectations) E301 expected 1 blank line, found 0 E302 expected 2 blank lines, found 1 E303 too many blank lines (n) --- git/db.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'git/db.py') diff --git a/git/db.py b/git/db.py index 0d12aeb4..415f7aa4 100644 --- a/git/db.py +++ b/git/db.py @@ -20,7 +20,10 @@ from gitdb.db import LooseObjectDB __all__ = ('GitCmdObjectDB', 'GitDB' ) #class GitCmdObjectDB(CompoundDB, ObjectDBW): + + class GitCmdObjectDB(LooseObjectDB): + """A database representing the default git object store, which includes loose objects, pack files and an alternates file @@ -28,6 +31,7 @@ class GitCmdObjectDB(LooseObjectDB): :note: for now, we use the git command to do all the lookup, just until he have packs and the other implementations """ + def __init__(self, root_path, git): """Initialize this instance with the root and a git command""" super(GitCmdObjectDB, self).__init__(root_path) @@ -42,7 +46,6 @@ class GitCmdObjectDB(LooseObjectDB): hexsha, typename, size, stream = self._git.stream_object_data(bin_to_hex(sha)) return OStream(hex_to_bin(hexsha), typename, size, stream) - # { Interface def partial_to_complete_sha_hex(self, partial_hexsha): -- cgit v1.2.3 From 614907b7445e2ed8584c1c37df7e466e3b56170f Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sun, 16 Nov 2014 20:56:53 +0100 Subject: pep8 linting (whitespace before/after) E201 whitespace after '(' E202 whitespace before ')' E203 whitespace before ':' E225 missing whitespace around operator E226 missing whitespace around arithmetic operator E227 missing whitespace around bitwise or shift operator E228 missing whitespace around modulo operator E231 missing whitespace after ',' E241 multiple spaces after ',' E251 unexpected spaces around keyword / parameter equals --- git/db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git/db.py') diff --git a/git/db.py b/git/db.py index 415f7aa4..5bb45a5e 100644 --- a/git/db.py +++ b/git/db.py @@ -17,7 +17,7 @@ from gitdb.db import GitDB from gitdb.db import LooseObjectDB -__all__ = ('GitCmdObjectDB', 'GitDB' ) +__all__ = ('GitCmdObjectDB', 'GitDB') #class GitCmdObjectDB(CompoundDB, ObjectDBW): -- cgit v1.2.3 From c8e70749887370a99adeda972cc3503397b5f9a7 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sun, 16 Nov 2014 21:09:47 +0100 Subject: pep8 linting (trailing whitespace) W291 trailing whitespace --- git/db.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'git/db.py') diff --git a/git/db.py b/git/db.py index 5bb45a5e..2cafd766 100644 --- a/git/db.py +++ b/git/db.py @@ -1,6 +1,6 @@ """Module with our own gitdb implementation - it uses the git command""" from exc import ( - GitCommandError, + GitCommandError, BadObject ) @@ -10,7 +10,7 @@ from gitdb.base import ( ) from gitdb.util import ( - bin_to_hex, + bin_to_hex, hex_to_bin ) from gitdb.db import GitDB @@ -24,11 +24,11 @@ __all__ = ('GitCmdObjectDB', 'GitDB') class GitCmdObjectDB(LooseObjectDB): - """A database representing the default git object store, which includes loose + """A database representing the default git object store, which includes loose objects, pack files and an alternates file It will create objects only in the loose object database. - :note: for now, we use the git command to do all the lookup, just until he + :note: for now, we use the git command to do all the lookup, just until he have packs and the other implementations """ @@ -52,7 +52,7 @@ class GitCmdObjectDB(LooseObjectDB): """:return: Full binary 20 byte sha from the given partial hexsha :raise AmbiguousObjectName: :raise BadObject: - :note: currently we only raise BadObject as git does not communicate + :note: currently we only raise BadObject as git does not communicate AmbiguousObjects separately""" try: hexsha, typename, size = self._git.get_object_header(partial_hexsha) -- cgit v1.2.3