Changeset 3079

Show
Ignore:
Timestamp:
01/17/08 13:23:54 (10 months ago)
Author:
TerryBrown
Message:

Added regular expression filtering of the components listed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • componentsprocessormacro/0.11/ComponentsListMacro.py

    r2810 r3079  
    11# -*- coding: utf-8 -*- 
    2 """Adds a wiki macro [[Components]] which lists and describes the project's components, and links to wiki pages describing the components in more detail, and any tickets for the components. 
     2"""Adds a wiki macro [[Components(pattern)]] which lists and describes the project's components, and links to wiki pages describing the components in more detail, and any tickets for the components.  The optional pattern parameter is a regex that can be used to filter components. 
    33 
    44terry_n_brown@yahoo.com 
     
    77import inspect 
    88import sys 
     9import re 
    910 
    1011from trac.core import Component, implements 
     
    2324        return inspect.getdoc(sys.modules.get(self.__module__)) 
    2425 
    25     def expand_macro(self, formatter, name, content): 
     26    def expand_macro(self, formatter, name, pattern): 
    2627 
    2728        cursor = self.env.get_db_cnx().cursor() 
     
    4041 
    4142        for name, descrip in comps: 
     43            if pattern and not re.match(pattern, name): continue 
    4244            dt = ' [wiki:%s]' % name 
    4345            if name in tickets: