summaryrefslogtreecommitdiff
path: root/lib/git/objects/blob.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/git/objects/blob.py')
-rw-r--r--lib/git/objects/blob.py42
1 files changed, 21 insertions, 21 deletions
diff --git a/lib/git/objects/blob.py b/lib/git/objects/blob.py
index 11dee323..3f91d078 100644
--- a/lib/git/objects/blob.py
+++ b/lib/git/objects/blob.py
@@ -8,29 +8,29 @@ import mimetypes
import base
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__ = tuple()
+ __slots__ = tuple()
-
- @property
- def mime_type(self):
- """
- The mime type of this file (based on the filename)
+
+ @property
+ def mime_type(self):
+ """
+ The mime type of this file (based on the filename)
- Returns
- str
-
- NOTE
- Defaults to 'text/plain' in case the actual file type is unknown.
- """
- guesses = None
- if self.path:
- guesses = mimetypes.guess_type(self.path)
- return guesses and guesses[0] or self.DEFAULT_MIME_TYPE
+ Returns
+ str
+
+ NOTE
+ Defaults to 'text/plain' in case the actual file type is unknown.
+ """
+ guesses = None
+ if self.path:
+ guesses = mimetypes.guess_type(self.path)
+ return guesses and guesses[0] or self.DEFAULT_MIME_TYPE
- def __repr__(self):
- return '<git.Blob "%s">' % self.sha
+ def __repr__(self):
+ return '<git.Blob "%s">' % self.sha