From 160081b9a7ca191afbec077c4bf970cfd9070d2c Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 29 Jun 2010 18:28:31 +0200 Subject: Updated and fixed sphinx API docs, which included one quick skim-through --- lib/git/objects/blob.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/git/objects/blob.py') diff --git a/lib/git/objects/blob.py b/lib/git/objects/blob.py index 8263e9a2..d0ef54c7 100644 --- a/lib/git/objects/blob.py +++ b/lib/git/objects/blob.py @@ -28,7 +28,8 @@ class Blob(base.IndexObject): @property def mime_type(self): - """ :return:String describing the mime type of this file (based on the filename) + """ + :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: -- cgit v1.2.1 From 18be0972304dc7f1a2a509595de7da689bddbefa Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 29 Jun 2010 20:16:37 +0200 Subject: Removed blob.data property as there is no real reason for an exception to the rule of trying not to cache possibly heavy data. The data_stream method should be used instead --- lib/git/objects/blob.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'lib/git/objects/blob.py') diff --git a/lib/git/objects/blob.py b/lib/git/objects/blob.py index d0ef54c7..32f8c61c 100644 --- a/lib/git/objects/blob.py +++ b/lib/git/objects/blob.py @@ -14,17 +14,7 @@ class Blob(base.IndexObject): DEFAULT_MIME_TYPE = "text/plain" type = "blob" - __slots__ = "data" - - def _set_cache_(self, attr): - if attr == "data": - ostream = self.repo.odb.stream(self.binsha) - self.size = ostream.size - self.data = ostream.read() - # assert ostream.type == self.type, _assertion_msg_format % (self.binsha, ostream.type, self.type) - else: - super(Blob, self)._set_cache_(attr) - # END handle data + __slots__ = tuple() @property def mime_type(self): -- cgit v1.2.1