diff options
Diffstat (limited to 'lib/git/objects/blob.py')
-rw-r--r-- | lib/git/objects/blob.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/git/objects/blob.py b/lib/git/objects/blob.py index ed7a8d04..8263e9a2 100644 --- a/lib/git/objects/blob.py +++ b/lib/git/objects/blob.py @@ -10,11 +10,11 @@ import base __all__ = ('Blob', ) class Blob(base.IndexObject): - """A Blob encapsulates a git blob object""" - DEFAULT_MIME_TYPE = "text/plain" - type = "blob" + """A Blob encapsulates a git blob object""" + DEFAULT_MIME_TYPE = "text/plain" + type = "blob" - __slots__ = "data" + __slots__ = "data" def _set_cache_(self, attr): if attr == "data": @@ -26,11 +26,11 @@ class Blob(base.IndexObject): super(Blob, self)._set_cache_(attr) # END handle data - @property - def mime_type(self): - """ :return:String describing the mime type of this file (based on the filename) - :note: Defaults to 'text/plain' in case the actual file type is unknown. """ - guesses = None - if self.path: - guesses = guess_type(self.path) - return guesses and guesses[0] or self.DEFAULT_MIME_TYPE + @property + def mime_type(self): + """ :return:String describing the mime type of this file (based on the filename) + :note: Defaults to 'text/plain' in case the actual file type is unknown. """ + guesses = None + if self.path: + guesses = guess_type(self.path) + return guesses and guesses[0] or self.DEFAULT_MIME_TYPE |