Changes between Version 3 and Version 4 of AdvParseArgsPlugin


Ignore:
Timestamp:
Oct 27, 2009 3:10:41 PM (5 years ago)
Author:
martin_s
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvParseArgsPlugin

    v3 v4  
    1 = Advanced Argument Parser for Trac Macros = 
     1= Advanced Argument Parser for WikiMacros = 
     2[[TOC]] 
    23 
    34== Description == 
    45 
    5 This plug-in provides an advanced version of the `parse_args` function for Trac macros. 
     6This plug-in provides an advanced version of the `parse_args` function for WikiMacros. 
     7 
     8This function is used in WikiMacros to parse the macro arguments. This enhanced version is meant as a replacement of `trac.wiki.macros.parse_args` and supports several advanced options (see section [#Parameters]). The most important feature is the support for quoting the delimiter, e.g. '`key1=val1,key2="some,text",key3=val3`' will correctly return '`some,text`' as the value of `key2`. The original `parse_args` function would return '`"some`' and handle '`text"`' as separate argument. 
    69 
    710== Documentation == 
    8 (pending) 
     11 
     12=== Definition === 
     13{{{ 
     14#!python 
     15def parse_args (args, strict = True, multi = False, listonly = False, minlen = 0, 
     16        quotechar = '"', escchar = '\\', delim = ',', delquotes = False) 
     17}}} 
     18 
     19=== Usage Example === 
     20 
     21{{{ 
     22#!python 
     23# Instead of: from trac.wiki.macros import parse_args 
     24# Use: 
     25from tracadvparseargs import parse_args 
     26 
     27 
     28class SomeMacro(WikiMacroBase): 
     29    def expand_macro(self, formatter, name, args): 
     30        largs, kwargs = parse_args( args, <options> ) 
     31}}} 
     32 
    933=== Parameters === 
    1034 `args`:: The argument string; 'content' in `expand_macro. 
     
    2751 `delquotes`:: Selects if quotes should be removed. 
    2852 
     53== TracHacks Macros which use this Function ==  
     54  * GoogleMapMacro 
    2955 
    3056== Bugs/Feature Requests ==  
     
    4470You can check out AdvParseArgsPlugin from [http://trac-hacks.org/svn/advparseargsplugin here] using Subversion, or [source:advparseargsplugin browse the source] with Trac. 
    4571 
    46 == Example == 
    47  
    48 {{{ 
    49 #!python 
    50 from tracadvparseargs import parse_args 
    51 }}} 
    5272 
    5373== Recent Changes ==