diff MoinMoin/items/__init__.py @ 1798:d139d7aad071

Add @timed() to several methods of Item related to index view.
author Cheer Xiao <xiaqqaix@gmail.com>
date Sat, 29 Sep 2012 23:55:55 +0800
parents 54160346e469
children 54062fc0ca97
line wrap: on
line diff
--- a/MoinMoin/items/__init__.py	Sat Sep 22 15:31:00 2012 +0200
+++ b/MoinMoin/items/__init__.py	Sat Sep 29 23:55:55 2012 +0800
@@ -44,6 +44,7 @@
 from MoinMoin.themes import render_template
 from MoinMoin.util.interwiki import url_for_item
 from MoinMoin.util.registry import RegistryBase
+from MoinMoin.util.clock import timed
 from MoinMoin.forms import RequiredText, OptionalText, JSON, Tags, Submit
 from MoinMoin.constants.keys import (
     NAME, NAME_OLD, NAME_EXACT, WIKINAME, MTIME, SYSITEM_VERSION, ITEMTYPE,
@@ -429,6 +430,7 @@
     def subitems_prefix(self):
         return self.name + u'/' if self.name else u''
 
+    @timed()
     def get_subitem_revs(self):
         """
         Create a list of subitems of this item.
@@ -443,6 +445,7 @@
         revs = flaskg.storage.search(query, sortedby=NAME_EXACT, limit=None)
         return revs
 
+    @timed()
     def make_flat_index(self, subitems):
         """
         Create a list of IndexEntry from a list of subitems.
@@ -499,6 +502,7 @@
 
         return index
 
+    @timed()
     def filter_index(self, index, startswith=None, selected_groups=None):
         """
         Filter a list of IndexEntry.