~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to MoinMoin/macro/EditedSystemPages.py

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mfrom: (0.9.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080622211713-fpo2zrq3s5dfecxg
Tags: 1.7.0-3
Simplify /etc/moin/wikilist format: "USER URL" (drop unneeded middle
CONFIG_DIR that was wrongly advertised as DATA_DIR).  Make
moin-mass-migrate handle both formats and warn about deprecation of
the old one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
class EditedSystemPages:
10
10
 
11
 
    def __init__(self, macro, args):
 
11
    def __init__(self, macro):
12
12
        self.macro = macro
13
13
        self.request = macro.request
14
14
        self.formatter = macro.formatter
23
23
 
24
24
        # Get page list for current user (use this as admin), filter
25
25
        # pages that are both underlay and standard pages.
26
 
        def filter(name):
 
26
        def filterfn(name):
27
27
            page = Page(self.request, name)
28
28
            return (page.isStandardPage(includeDeleted=0) and
29
29
                    page.isUnderlayPage(includeDeleted=0))
30
30
 
31
31
        # Get page filtered page list. We don't need to filter by
32
32
        # exists, because our filter check this already.
33
 
        pages = self.request.rootpage.getPageList(filter=filter, exists=0)
34
 
           
35
 
        # Format as numberd list, sorted by page name         
 
33
        pages = self.request.rootpage.getPageList(filter=filterfn, exists=0)
 
34
 
 
35
        # Format as numberd list, sorted by page name
36
36
        pages.sort()
37
37
        result = []
38
38
        f = self.formatter
44
44
            result.append(f.pagelink(0, name))
45
45
            result.append(f.listitem(0))
46
46
        result.append(f.number_list(0))
47
 
        
 
47
 
48
48
        return ''.join(result)
49
49
 
50
50
 
51
 
def execute(macro, args):
 
51
def macro_EditedSystemPages(macro):
52
52
    """ Temporary glue code to use with moin current macro system """
53
 
    return EditedSystemPages(macro, args).renderInPage()
 
53
    return EditedSystemPages(macro).renderInPage()
54
54