[kupfer] Support decorating FileLeaf with content



commit 2f85d53c6cc735c349a510a3142eed18feeafe83
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Sun Jan 3 18:19:46 2010 +0100

    Support decorating FileLeaf with content
    
    We support decoration of non-directory FileLeaves with content, by
    delegating that case to the superclass Leaf.

 kupfer/objects.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/kupfer/objects.py b/kupfer/objects.py
index 2b0e5cb..83b48e8 100644
--- a/kupfer/objects.py
+++ b/kupfer/objects.py
@@ -283,9 +283,9 @@ class FileLeaf (Leaf, TextRepresentation):
 		return acts
 
 	def has_content(self):
-		return path.isdir(self.object)
+		return self.is_dir() or Leaf.has_content(self)
 	def content_source(self, alternate=False):
-		if self.has_content():
+		if self.is_dir():
 			return DirectorySource(self.object, show_hidden=alternate)
 		else:
 			return Leaf.content_source(self)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]