degal/folder.py
changeset 85 7da934333469
parent 77 2a53c5ade434
child 90 606bae04f79b
--- a/degal/folder.py	Wed Jun 10 23:33:28 2009 +0300
+++ b/degal/folder.py	Thu Jun 11 00:36:19 2009 +0300
@@ -19,7 +19,7 @@
         # info
         self.title = None
         self.description = None
-
+        
     @lazy_load
     def preview_dir (self) :
         """
@@ -114,17 +114,17 @@
         else :
             return self.subfile("index.html")
     
-    def index (self) :
+    def index_images (self, for_update=True) :
         """
-            Recursively index this Folder, yielding a series of all Folder objects inside.
+            Return a series of Images inside of this folder.
 
-            XXX: not used
+            If `for_update` is given, only images that are stale will be returned.
         """
         
-        # and subfolders
-        for subfolder in self.subfolders :
-            yield subfolder
+        for image in self.images :
+            if for_update and not image.stale() :
+                # skip 
+                continue
 
-            for item in subfolder.index_subfolders() :
-                yield item
-   
+            yield image
+