changeset 1907:3799c27e664a

Page.getPageLinks() - minor refactoring
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 24 Mar 2007 22:25:00 +0100
parents 4c424f7b5d55
children 8bd4b581cc60
files MoinMoin/Page.py
diffstat 1 files changed, 14 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Fri Mar 23 22:20:11 2007 +0100
+++ b/MoinMoin/Page.py	Sat Mar 24 22:25:00 2007 +0100
@@ -1378,20 +1378,20 @@
         @rtype: list
         @return: page names this page links to
         """
-        if not self.exists():
-            return []
-        cache = caching.CacheEntry(request, self, 'pagelinks', scope='item', do_locking=False, use_pickle=True)
-        if cache.needsUpdate(self._text_filename()):
-            links = self.parsePageLinks(request)
-            cache.update(links)
-            return links
-        try:
-            links = cache.content()
-            return links
-        except caching.CacheError:
-            links = self.parsePageLinks(request)
-            cache.update(links)
-            return links
+        if self.exists():
+            cache = caching.CacheEntry(request, self, 'pagelinks', scope='item', do_locking=False, use_pickle=True)
+            if cache.needsUpdate(self._text_filename()):
+                links = self.parsePageLinks(request)
+                cache.update(links)
+            else:
+                try:
+                    links = cache.content()
+                except caching.CacheError:
+                    links = self.parsePageLinks(request)
+                    cache.update(links)
+        else:
+            links = []
+        return links
 
     def parsePageLinks(self, request):
         """ Parse page links by formatting with a pagelinks formatter