diff -r 7ea9766e33ed -r 9387da0dc183 degal/folder.py --- a/degal/folder.py Wed Jul 01 20:25:35 2009 +0300 +++ b/degal/folder.py Wed Jul 01 20:40:00 2009 +0300 @@ -13,7 +13,7 @@ A Folder is a filesystem Directory that: * has a title/description (XXX: Page) * contains any number of other sub-Folders and Images. - * can load custom configuration for itself and sub-nodes to override the base config + * maintains a hierarchial Configuration that can be overrided for sub-nodes * holds sub-dirs for previews/thumbs * has a HTML view """ @@ -26,11 +26,22 @@ """ yield self.subfile('degal.cfg') + + def _init_config (self) : + """ + Initialize .config for ourselves. + """ + + # use parent's config + return self.parent.config def __init__ (self, *args, **kwargs) : super(Folder, self).__init__(*args, **kwargs) - - # find config + + # load .config + self.config = self._init_config() + + # find custom config? for file in self.iter_config_files() : if file.exists() : # yay! More configuration! @@ -46,7 +57,7 @@ # disable it so it won't be used by children # XXX: figure out a better way of doing this self.config.title = None - + @lazy_load def title (self) : """