changeset 57:7f56d8a670da

text_x_arnica: some doc strings added
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Wed, 04 Jun 2008 14:41:57 +0200
parents d988ec9aa2f5
children 4381f580a434
files data/plugin/parser/text_x_arnica.py
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/parser/text_x_arnica.py	Wed Jun 04 14:32:39 2008 +0200
+++ b/data/plugin/parser/text_x_arnica.py	Wed Jun 04 14:41:57 2008 +0200
@@ -44,7 +44,8 @@
                  renew=False,
                  thumbnail_width=int(128), webnail_width=int(640),
                  text_width=int(128)):
-    """ macro to initialize all default parameters for arnica
+    """ macro to initialize all default parameters for arnica. The definition is checked for wrong input.
+    @param macro: is used from wikiutil.invoke_extension_function
 
     @param target_page: page to read attachments from
     @param columns: number of columns for thumbnails
@@ -77,7 +78,7 @@
     """
     from inspect import getargspec
     args, varargs, varkw, defaults = getargspec(macro_arnica)
-    # XXX find the proper method do get the real values
+    # ToDo find the proper method do get the real values without entering the list
     defaults = (target_page, columns, file_regex,
                 image_for_webnail,
                 show_text, show_date, show_tools,
@@ -120,11 +121,14 @@
         macro = self._make_macro()
         args = kw.get('format_args', '')
         self.init_settings = False
+        # we use a macro definition to initialize the default init parameters
+        # if a user enters a wrong parameter the failure is shown by the exception
         try:
             settings = wikiutil.invoke_extension_function(macro.request, macro_arnica, args, [macro])
             keys, values = settings
             for i in range(len(keys)):
                 setattr(self, keys[i], values[i])
+            # saves the state of valid input
             self.init_settings = True
         except ValueError, err:
             msg = u"arnica: %s" % err.args[0]
@@ -142,7 +146,7 @@
         self.webimg = [] # array of images for forms
 
     def _make_macro(self):
-        """Test helper"""
+        """macro helper used to create the macro object"""
         from MoinMoin import macro
         from MoinMoin.parser.text import Parser
         from MoinMoin.formatter.text_html import Formatter
@@ -550,6 +554,7 @@
 
         _ = self._
 
+        # checks if nitializing of all attributes in __init__ was done
         if not self.init_settings:
             return