Changes between Version 12 and Version 13 of AdvParseArgsPlugin
- Timestamp:
- May 11, 2015, 5:00:23 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AdvParseArgsPlugin
v12 v13 1 1 [[PageOutline(2-5,Contents,pullout)]] 2 2 3 = Advanced Argument Parser for WikiMacros =3 = Advanced Argument Parser for WikiMacros 4 4 5 == Description ==5 == Description 6 6 7 This plug -in provides an advanced version of the `parse_args` function for WikiMacros.7 This plugin provides an advanced version of the `parse_args` function for WikiMacros. 8 8 9 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.9 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, eg `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. 10 10 11 == Documentation == 11 Trac-hacks which use this plugin: 12 12 13 === Definition === 14 {{{ 15 #!python 13 * GoogleMapMacro 14 * GoogleStaticMapMacro 15 * ListOfWikiPagesMacro 16 * TicketStatsMacro 17 * TicketChartsMacro 18 19 == Documentation 20 21 === Definition 22 23 {{{#!python 16 24 def parse_args (args, strict = True, multi = False, listonly = False, minlen = 0, 17 25 quotechar = '"', escchar = '\\', delim = ',', delquotes = False) 18 26 }}} 19 27 20 === Usage Example ===28 === Usage Example 21 29 22 {{{ 23 #!python 30 {{{#!python 24 31 # Instead of: from trac.wiki.macros import parse_args 25 32 # Use: 26 33 from tracadvparseargs import * 27 28 34 29 35 class SomeMacro(WikiMacroBase): … … 32 38 }}} 33 39 34 === Parameters === 40 === Parameters 41 35 42 `args`:: The argument string; 'content' in `expand_macro. This is the only mandatory argument. 36 43 `strict`:: Enables strict checking of keys. … … 52 59 `delquotes`:: Selects if quotes should be removed. 53 60 54 == TracHacks Macros which use this Function == 55 * GoogleMapMacro 56 * GoogleStaticMapMacro 57 * ListOfWikiPagesMacro 58 * TicketStatsMacro 59 * TicketChartsMacro 60 61 == Bugs/Feature Requests == 61 == Bugs/Feature Requests 62 62 63 63 Existing bugs and feature requests for AdvParseArgsPlugin are … … 67 67 [http://trac-hacks.org/newticket?component=AdvParseArgsPlugin&owner=martin_s new ticket]. 68 68 69 == Download == 69 [[TicketQuery(component=AdvParseArgsPlugin&group=type,format=progress)]] 70 71 == Download 70 72 71 73 Download the zipped source from [download:advparseargsplugin/0.11 here]. … … 75 77 This package is also available from the [http://pypi.python.org/pypi/TracAdvParseArgsPlugin Python Package Index]. 76 78 77 == Source ==79 == Source 78 80 79 81 You can check out AdvParseArgsPlugin from [http://trac-hacks.org/svn/advparseargsplugin here] using Subversion, or [source:advparseargsplugin browse the source] with Trac. 80 82 81 82 == Recent Changes == 83 == Recent Changes 83 84 84 85 [[ChangeLog(advparseargsplugin, 3)]] 85 86 86 == Author/Contributors ==87 == Author/Contributors 87 88 88 89 '''Author:''' [wiki:martin_s] [[BR]] 89 '''Maintainer:''' [ wiki:martin_s] [[BR]]90 '''Maintainer:''' [[Maintainer]] [[BR]] 90 91 '''Contributors:'''