aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Rossi <alexandre.rossi@gmail.com>2018-07-06 12:14:07 +0200
committerAlexandre Rossi <alexandre.rossi@gmail.com>2018-07-06 12:14:07 +0200
commit7008c0ecc22013d07825aa4fa2f6358c8ae9bd6e (patch)
treebc537a29a3dcf12ea1c592b84fb8977d1bdffad6
parent10908b342d3c7d6ab657ea282e871b7cd839716f (diff)
downloadlazygal-7008c0ecc22013d07825aa4fa2f6358c8ae9bd6e.zip
lazygal-7008c0ecc22013d07825aa4fa2f6358c8ae9bd6e.tar.bz2
fixup! fix crash on rebuild with --dir-flattening-depth (Debian Closes: #902764)
-rw-r--r--lazygal/generators.py14
-rw-r--r--lazygal/pindex.py2
2 files changed, 8 insertions, 8 deletions
diff --git a/lazygal/generators.py b/lazygal/generators.py
index c397d55..751f25a 100644
--- a/lazygal/generators.py
+++ b/lazygal/generators.py
@@ -144,6 +144,7 @@ class SubgalBreak(make.MakeTask):
if self.webgal_dir.flatten_below():
subgals = []
for dir in self.webgal_dir.get_all_subgals():
+ dir.call_populate_deps()
galleries.append((dir, dir.medias))
else:
subgals = self.webgal_dir.subgals
@@ -319,7 +320,7 @@ class WebalbumDir(make.GroupTask):
self.progress = progress
self.add_dependency(self.source_dir)
- self._init_subgals = subgals
+ self.subgals = subgals
for srcdir in self.source_dir.subdirs:
self.add_dependency(srcdir)
self.album = album
@@ -337,10 +338,9 @@ class WebalbumDir(make.GroupTask):
def populate_deps(self):
super(WebalbumDir, self).populate_deps()
- self.subgals = []
- for s in self._init_subgals:
- if s.has_media_below():
- self.subgals.append(s)
+ for s in self.subgals:
+ if not s.has_media_below():
+ self.subgals.remove(s)
self.medias = []
self.sort_task = SubgalSort(self)
@@ -564,7 +564,7 @@ class WebalbumDir(make.GroupTask):
def has_media_below(self):
if self.has_media():
return True
- for subgal in self._init_subgals:
+ for subgal in self.subgals:
if subgal.has_media_below():
return True
return False
@@ -580,7 +580,7 @@ class WebalbumDir(make.GroupTask):
elif self.source_dir.subdirs:
# As all subdirs are at the same level, if one should be flattened,
# all should.
- return self._init_subgals[0].should_be_flattened()
+ return self.subgals[0].should_be_flattened()
else:
return False
diff --git a/lazygal/pindex.py b/lazygal/pindex.py
index 30c4b93..3dd4d00 100644
--- a/lazygal/pindex.py
+++ b/lazygal/pindex.py
@@ -101,7 +101,7 @@ class PersistentIndex(make.FileMakeObject):
'video' : self.data['count']['video'],
}
- for subgal in self.webgal._init_subgals:
+ for subgal in self.webgal.subgals:
for count_type in self.data['all_count']:
self.data['all_count'][count_type] =\
self.data['all_count'][count_type] +\