changeset 503:84e949d36271

macro.CollectLists: doc string updated and PEP8 whitespace fixed
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sat, 20 Feb 2010 10:42:07 +0100
parents f9845325cfcf
children 31e92294799a
files data/plugin/macro/CollectLists.py
diffstat 1 files changed, 29 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/macro/CollectLists.py	Wed Feb 17 15:52:17 2010 +0100
+++ b/data/plugin/macro/CollectLists.py	Sat Feb 20 10:42:07 2010 +0100
@@ -1,24 +1,35 @@
 # -*- coding: iso-8859-1 -*-
 """
-    MoinMoin - macro to collect data from definition lists from subpages
+    MoinMoin - macro to collect data from definition lists from pages
     into a databrowser widget table
 
     <<CollectLists>>
-    will create a table column for every subpage of the current page and fills in
-    the data from each key value pair of a definition list.
-    Optional you can give the template page the definition list page depends on
-    or the column_heading. In the latter case the order is used.
-    Also it can optionally use definition list from another pagename.
-    By setting optional a parser one can use e.g. wikimarkup from a different
-    parser than moinmoin.
-    By filter_selection you can optional use the filter method of the databrowser
-    widget (this needs javascript enabled).
-    By using a different filter_column_value than the default, eg. name:: Cohen  you
-    get only rows shown where that name was found.
-    By using the keyword transpose the table is shown transposed. Until transpose is not part
-    of the databrowser widget itselfs we don't support filter_selection by transpose=True.
-    
-    <<CollectLists(search_expression=title:Examplepage/)>
+    will create a on default a table row for every subpage of the current page
+    and a table column for each key and fills the cells with data from each
+    key value pair of a definition list. You can change the search_expression
+    keyword to any regex you want. All attributes to the macro are optional.
+    You can give as an attribute to the macro the name of the template page
+    the definition list page depends on.
+    You can also list the desired keys with the attribute column_heading.
+    In the latter case the table colunms will have the same order as the keys
+    listed.
+    The macro can finally also use the definition list from another pagename.
+    By setting a parser one can use a different parser than moinmoin's default
+    like for example wikimarkup.
+    With the attribute filter_selection you can use the filter method of the
+    databrowser widget (this needs javascript enabled).
+    By using a different filter_column_value than the default empty one,
+    eg. name:: Cohen you get only rows shown where that name was found.
+    If you want to rename your column titles later on that can be done
+    by adding the dictionary keyword pointing on a page with aliases
+    for your labels as definition list.
+    With sort_column_name given as list you can sort the table by
+    multiple columns. And sort_reverse=True makes it reverse.
+    By using the keyword transpose the table is shown transposed.
+    Until transpose is not part of the databrowser widget itselfs we
+    don't support every feature of this macro e.g. filter_selection.
+
+    <<CollectLists(search_expression=regex:title:^Examplepage/)>
 
     @copyright: 2006 by michael cohen <scudette@users.sourceforge.net> (PageDicts)
     @copyright: 2008-2010 by MoinMoin:ReimarBauer (completly rewritten)
@@ -44,7 +55,7 @@
 
 def table2rows(table):
     """
-    transforms a data.data table of widget data browser into an array of lists without tuples 
+    transforms a data.data table of widget data browser into an array of lists without tuples
     """
     rows = []
     for line in table:
@@ -216,3 +227,4 @@
     # http://moinmo.in/FeatureRequests/SortableTables?action=AttachFile&do=view&target=common.js.patch
     # html = html.replace('id="dbw.table', 'class="sortable" id="dbw.table')
     return html
+