Changes between Version 3 and Version 4 of AdvParseArgsPlugin
- Timestamp:
- Oct 27, 2009, 2:10:41 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AdvParseArgsPlugin
v3 v4 1 = Advanced Argument Parser for Trac Macros = 1 = Advanced Argument Parser for WikiMacros = 2 [[TOC]] 2 3 3 4 == Description == 4 5 5 This plug-in provides an advanced version of the `parse_args` function for Trac macros. 6 This plug-in provides an advanced version of the `parse_args` function for WikiMacros. 7 8 This 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. 6 9 7 10 == Documentation == 8 (pending) 11 12 === Definition === 13 {{{ 14 #!python 15 def 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: 25 from tracadvparseargs import parse_args 26 27 28 class SomeMacro(WikiMacroBase): 29 def expand_macro(self, formatter, name, args): 30 largs, kwargs = parse_args( args, <options> ) 31 }}} 32 9 33 === Parameters === 10 34 `args`:: The argument string; 'content' in `expand_macro. … … 27 51 `delquotes`:: Selects if quotes should be removed. 28 52 53 == TracHacks Macros which use this Function == 54 * GoogleMapMacro 29 55 30 56 == Bugs/Feature Requests == … … 44 70 You can check out AdvParseArgsPlugin from [http://trac-hacks.org/svn/advparseargsplugin here] using Subversion, or [source:advparseargsplugin browse the source] with Trac. 45 71 46 == Example ==47 48 {{{49 #!python50 from tracadvparseargs import parse_args51 }}}52 72 53 73 == Recent Changes ==