Package trac :: Package wiki :: Module api

Module api

source code

Classes
  IWikiChangeListener
Components that want to get notified about the creation, deletion and modification of wiki pages should implement that interface.
  IWikiPageManipulator
Components that need to do specific pre- and post- processing of wiki page changes have to implement this interface.
  IWikiMacroProvider
Augment the Wiki markup with new Wiki macros.
  IWikiSyntaxProvider
Enrich the Wiki syntax with new markup.
  WikiSystem
Wiki system manager.
Functions
 
parse_args(args, strict=True)
Utility for parsing macro "content" and splitting them into arguments.
source code
 
validate_page_name(pagename)
Utility for validating wiki page name.
source code
Variables
  __package__ = 'trac.wiki'

Imports: re, cached, BoolOption, ListOption, IResourceManager, is_safe_origin, tag, unquote_label, _, WikiParser, Component, ExtensionPoint, Interface, TracBaseError, TracError, TracValueError, implements


Function Details

parse_args(args, strict=True)

source code 

Utility for parsing macro "content" and splitting them into arguments.

The content is split along commas, unless they are escaped with a backquote (see example below).

Example usage:

>>> parse_args('')
([], {})
>>> parse_args('Some text')
(['Some text'], {})
>>> parse_args('Some text, mode= 3, some other arg\, with a comma.')
(['Some text', ' some other arg, with a comma.'], {'mode': ' 3'})
>>> parse_args('milestone=milestone1,status!=closed', strict=False)
([], {'status!': 'closed', 'milestone': 'milestone1'})
Parameters:
  • args - a string containing macros arguments
  • strict - if True, only Python-like identifiers will be recognized as keyword arguments

validate_page_name(pagename)

source code 
Utility for validating wiki page name.
Parameters:
  • pagename - wiki page name to validate