diff options
author | Antoine Musso <hashar@free.fr> | 2014-11-16 20:51:04 +0100 |
---|---|---|
committer | Antoine Musso <hashar@free.fr> | 2014-11-16 20:51:21 +0100 |
commit | be34ec23c48d6d5d8fd2ef4491981f6fb4bab8e6 (patch) | |
tree | 7d0124054760421d95a6f675d8e843e42a72ad82 /git/refs | |
parent | f5d11b750ecc982541d1f936488248f0b42d75d3 (diff) | |
download | gitpython-be34ec23c48d6d5d8fd2ef4491981f6fb4bab8e6.tar.gz |
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)
Diffstat (limited to 'git/refs')
-rw-r--r-- | git/refs/head.py | 4 | ||||
-rw-r--r-- | git/refs/log.py | 2 | ||||
-rw-r--r-- | git/refs/reference.py | 6 | ||||
-rw-r--r-- | git/refs/remote.py | 2 | ||||
-rw-r--r-- | git/refs/symbolic.py | 5 | ||||
-rw-r--r-- | git/refs/tag.py | 3 |
6 files changed, 12 insertions, 10 deletions
diff --git a/git/refs/head.py b/git/refs/head.py index 1b3e7f00..662c2c87 100644 --- a/git/refs/head.py +++ b/git/refs/head.py @@ -10,8 +10,8 @@ from git.exc import GitCommandError __all__ = ["HEAD", "Head"] - class HEAD(SymbolicReference): + """Special case of a Symbolic Reference as it represents the repository's HEAD reference.""" _HEAD_NAME = 'HEAD' @@ -92,6 +92,7 @@ class HEAD(SymbolicReference): class Head(Reference): + """A Head is a named reference to a Commit. Every Head instance contains a name and a Commit object. @@ -151,7 +152,6 @@ class Head(Reference): return self - def tracking_branch(self): """ :return: The remote_reference we are tracking, or None if we are diff --git a/git/refs/log.py b/git/refs/log.py index d5d8d7d4..8917f3fa 100644 --- a/git/refs/log.py +++ b/git/refs/log.py @@ -28,6 +28,7 @@ __all__ = ["RefLog", "RefLogEntry"] class RefLogEntry(tuple): + """Named tuple allowing easy access to the revlog data fields""" _fmt = "%s %s %s <%s> %i %s\t%s\n" _re_hexsha_only = re.compile('^[0-9A-Fa-f]{40}$') @@ -106,6 +107,7 @@ class RefLogEntry(tuple): class RefLog(list, Serializable): + """A reflog contains reflog entries, each of which defines a certain state of the head in question. Custom query methods allow to retrieve log entries by date or by other criteria. diff --git a/git/refs/reference.py b/git/refs/reference.py index d8f0c70f..a8ecc95d 100644 --- a/git/refs/reference.py +++ b/git/refs/reference.py @@ -12,8 +12,11 @@ from gitdb.util import ( __all__ = ["Reference"] #{ Utilities + + def require_remote_ref_path(func): """A decorator raising a TypeError if we are not a valid remote, based on the path""" + def wrapper(self, *args): if not self.path.startswith(self._remote_common_path_default + "/"): raise ValueError("ref path does not point to a remote reference: %s" % self.path) @@ -25,6 +28,7 @@ def require_remote_ref_path(func): class Reference(SymbolicReference, LazyMixin, Iterable): + """Represents a named reference to any object. Subclasses may apply restrictions though, i.e. Heads can only point to commits.""" __slots__ = tuple() @@ -45,7 +49,6 @@ class Reference(SymbolicReference, LazyMixin, Iterable): raise ValueError("Cannot instantiate %r from path %s" % (self.__class__.__name__, path)) super(Reference, self).__init__(repo, path) - def __str__(self): return self.name @@ -99,7 +102,6 @@ class Reference(SymbolicReference, LazyMixin, Iterable): #}END interface - #{ Remote Interface @property diff --git a/git/refs/remote.py b/git/refs/remote.py index 4c73b094..6dd0856c 100644 --- a/git/refs/remote.py +++ b/git/refs/remote.py @@ -9,10 +9,10 @@ __all__ = ["RemoteReference"] class RemoteReference(Head): + """Represents a reference pointing to a remote head.""" _common_path_default = Head._remote_common_path_default - @classmethod def iter_items(cls, repo, common_path = None, remote=None): """Iterate remote references, and if given, constrain them to the given remote""" diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py index 7a4bf59b..6832b8f2 100644 --- a/git/refs/symbolic.py +++ b/git/refs/symbolic.py @@ -23,7 +23,9 @@ from log import RefLog __all__ = ["SymbolicReference"] + class SymbolicReference(object): + """Represents a special case of a reference such that this reference is symbolic. It does not point to a specific commit, but to another Head, which itself specifies a commit. @@ -204,7 +206,6 @@ class SymbolicReference(object): return self - def set_object(self, object, logmsg = None): """Set the object we point to, possibly dereference our symbolic reference first. If the reference does not exist, it will be created @@ -309,7 +310,6 @@ class SymbolicReference(object): return self - # aliased reference reference = property(_get_reference, set_reference, doc="Returns the Reference we point to") ref = reference @@ -441,7 +441,6 @@ class SymbolicReference(object): os.remove(reflog_path) #END remove reflog - @classmethod def _create(cls, repo, path, resolve, reference, force, logmsg=None): """internal method used to create a new symbolic reference. diff --git a/git/refs/tag.py b/git/refs/tag.py index 110fc612..2845ec7c 100644 --- a/git/refs/tag.py +++ b/git/refs/tag.py @@ -3,8 +3,8 @@ from reference import Reference __all__ = ["TagReference", "Tag"] - class TagReference(Reference): + """Class representing a lightweight tag reference which either points to a commit ,a tag object or any other object. In the latter case additional information, like the signature or the tag-creator, is available. @@ -86,6 +86,5 @@ class TagReference(Reference): repo.git.tag("-d", *tags) - # provide an alias Tag = TagReference |