aboutsummaryrefslogtreecommitdiff
path: root/git/objects/tag.py
diff options
context:
space:
mode:
authorAntoine Musso <hashar@free.fr>2014-11-16 20:15:50 +0100
committerAntoine Musso <hashar@free.fr>2014-11-16 20:46:41 +0100
commitf5d11b750ecc982541d1f936488248f0b42d75d3 (patch)
tree8be522510315f5adc32c0c55acd45dc1074294da /git/objects/tag.py
parent7aba59a2609ec768d5d495dafd23a4bce8179741 (diff)
downloadGitPython-f5d11b750ecc982541d1f936488248f0b42d75d3.tar.gz
GitPython-f5d11b750ecc982541d1f936488248f0b42d75d3.zip
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
Diffstat (limited to 'git/objects/tag.py')
-rw-r--r--git/objects/tag.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/git/objects/tag.py b/git/objects/tag.py
index d0b5a11a..b34c5945 100644
--- a/git/objects/tag.py
+++ b/git/objects/tag.py
@@ -17,11 +17,11 @@ class TagObject(base.Object):
"""Non-Lightweight tag carrying additional information about an object we are pointing to."""
type = "tag"
__slots__ = ( "object", "tag", "tagger", "tagged_date", "tagger_tz_offset", "message" )
-
+
def __init__(self, repo, binsha, object=None, tag=None,
tagger=None, tagged_date=None, tagger_tz_offset=None, message=None):
"""Initialize a tag object with additional data
-
+
:param repo: repository this object is located in
:param binsha: 20 byte SHA1
:param object: Object instance of object we are pointing to
@@ -45,22 +45,22 @@ class TagObject(base.Object):
self.tagger_tz_offset = tagger_tz_offset
if message is not None:
self.message = message
-
+
def _set_cache_(self, attr):
"""Cache all our attributes at once"""
if attr in TagObject.__slots__:
ostream = self.repo.odb.stream(self.binsha)
lines = ostream.read().splitlines()
-
+
obj, hexsha = lines[0].split(" ") # object <hexsha>
type_token, type_name = lines[1].split(" ") # type <type_name>
self.object = get_object_type_by_name(type_name)(self.repo, hex_to_bin(hexsha))
-
+
self.tag = lines[2][4:] # tag <tag name>
-
+
tagger_info = lines[3]# tagger <actor> <date>
self.tagger, self.tagged_date, self.tagger_tz_offset = parse_actor_and_date(tagger_info)
-
+
# line 4 empty - it could mark the beginning of the next header
# in case there really is no message, it would not exist. Otherwise
# a newline separates header from message
@@ -71,6 +71,3 @@ class TagObject(base.Object):
# END check our attributes
else:
super(TagObject, self)._set_cache_(attr)
-
-
-