[library-web] avoid duplicated pages when creating mallard cache



commit ea90292618b506f488e2f6b95be414d10a3c8e33
Author: Frédéric Péters <fpeters 0d be>
Date:   Wed Jan 29 21:17:33 2014 +0000

    avoid duplicated pages when creating mallard cache

 src/modtypes/mallard.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/modtypes/mallard.py b/src/modtypes/mallard.py
index 86876ae..3cbadf7 100644
--- a/src/modtypes/mallard.py
+++ b/src/modtypes/mallard.py
@@ -172,6 +172,9 @@ class MallardCache:
         page = MallardPage(filename)
         if page.id is None:
             return
+        if page.id in [x.id for x in self.all_pages]:
+            # avoid duplicated pages
+            return
         self.all_pages.append(page)
         return page
 


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