Changeset 3957

Show
Ignore:
Timestamp:
07/04/08 03:38:47 (2 months ago)
Author:
gotoh
Message:

Add new keyword 'nosort' to display tickets without sorting.
This is usefull for listing ticket by report.
(This feature is requested by Eleonore in trac-users ML)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ticketboxmacro/0.10/TicketBox.py

    r3423 r3957  
    1919[[TicketBox(\"Other Title\",#1,#2)]]     ... likewise 
    2020[[TicketBox('%d tickets',#1,#2)]]      ... embed ticket count in title 
     21[[TicketBox({1}, nosort)]]             ... display numbers without sort 
    2122}}} 
    2223 
     
    5758            r"\[report:(?P<rptnum2>\d+)(?P<dv>\?.*)?\]", 
    5859            r"(?P<width>\d+(pt|px|%))", 
    59             r"(?P<summary>summary)", 
    60             r"(?P<inline>inline)", 
     60            r"(?P<keyword>nosort|summary|inline)", 
    6161            r"(?P<title1>'.*')", 
    6262            r'(?P<title2>".*")'] 
     
    8080    show_summary = False 
    8181    inline = False 
     82    nosort = False 
    8283    title = "Tickets" 
    8384    args_re = re.compile("^(?:" + string.join(args_pat, "|") + ")$") 
     
    9596        elif match.group('tktnum'): 
    9697            items.append(int(match.group('tktnum'))) 
    97         elif match.group('summary'): 
    98             show_summary = True 
    99         elif match.group('inline'): 
    100             inline = True 
     98        elif match.group('keyword'): 
     99            kw = match.group('keyword').lower() 
     100            if kw == 'summary': 
     101                show_summary = True 
     102            elif kw == 'inline': 
     103                inline = True 
     104            elif kw == 'nosort': 
     105                nosort = True 
    101106        elif match.group('rptnum') or match.group('rptnum2'): 
    102107            num = match.group('rptnum') or match.group('rptnum2') 
     
    145150                    db.close() 
    146151    items = uniq(items) 
    147     items.sort() 
     152    if not nosort: 
     153        items.sort() 
    148154    html = '' 
    149155 
  • ticketboxmacro/0.11/TicketBox.py

    r3822 r3957  
    1919[[TicketBox(\"Other Title\",#1,#2)]]     ... likewise 
    2020[[TicketBox('%d tickets',#1,#2)]]      ... embed ticket count in title 
     21[[TicketBox({1}, nosort)]]             ... display numbers without sort 
    2122}}} 
    2223 
     
    4748            r"\[report:(?P<rptnum2>\d+)(?P<dv>\?.*)?\]", 
    4849            r"(?P<width>\d+(pt|px|%))", 
    49             r"(?P<summary>summary)", 
    50             r"(?P<inline>inline)", 
     50            r"(?P<keyword>nosort|summary|inline)", 
    5151            r"(?P<title1>'.*')", 
    5252            r'(?P<title2>".*")'] 
     
    7373    show_summary = False 
    7474    inline = False 
     75    nosort = False 
    7576    title = "Tickets" 
    7677    args_re = re.compile("^(?:" + string.join(args_pat, "|") + ")$") 
     
    8889        elif match.group('tktnum'): 
    8990            items.append(int(match.group('tktnum'))) 
    90         elif match.group('summary'): 
    91             show_summary = True 
    92         elif match.group('inline'): 
    93             inline = True 
     91        elif match.group('keyword'): 
     92            kw = match.group('keyword').lower() 
     93            if kw == 'summary': 
     94                show_summary = True 
     95            elif kw == 'inline': 
     96                inline = True 
     97            elif kw == 'nosort': 
     98                nosort = True 
    9499        elif match.group('rptnum') or match.group('rptnum2'): 
    95100            num = match.group('rptnum') or match.group('rptnum2') 
     
    131136                    db.close() 
    132137    items = uniq(items) 
    133     items.sort() 
     138    if not nosort: 
     139        items.sort() 
    134140    html = '' 
    135141    if show_summary: 
  • ticketboxmacro/0.9/TicketBox.py

    r3423 r3957  
    1919[[TicketBox(\"Other Title\",#1,#2)]]     ... likewise 
    2020[[TicketBox('%d tickets',#1,#2)]]      ... embed ticket count in title 
     21[[TicketBox({1}, nosort)]]             ... display numbers without sort 
    2122}}} 
    2223 
     
    5354            r"\[report:(?P<rptnum2>\d+)(?P<dv>\?.*)?\]", 
    5455            r"(?P<width>\d+(pt|px|%))", 
    55             r"(?P<summary>summary)", 
    56             r"(?P<inline>inline)", 
     56            r"(?P<keyword>nosort|summary|inline)", 
    5757            r"(?P<title1>'.*')", 
    5858            r'(?P<title2>".*")'] 
     
    7676    show_summary = False 
    7777    inline = False 
     78    nosort = False 
    7879    title = "Tickets" 
    7980    args_re = re.compile("^(?:" + string.join(args_pat, "|") + ")$") 
     
    9192        elif match.group('tktnum'): 
    9293            items.append(int(match.group('tktnum'))) 
    93         elif match.group('summary'): 
    94             show_summary = True 
    95         elif match.group('inline'): 
    96             inline = True 
     94        elif match.group('keyword'): 
     95            kw = match.group('keyword').lower() 
     96            if kw == 'summary': 
     97                show_summary = True 
     98            elif kw == 'inline': 
     99                inline = True 
     100            elif kw == 'nosort': 
     101                nosort = True 
    97102        elif match.group('rptnum') or match.group('rptnum2'): 
    98103            num = match.group('rptnum') or match.group('rptnum2') 
     
    135140                    db.close() 
    136141    items = uniq(items) 
    137     items.sort() 
     142    if not nosort: 
     143        items.sort() 
    138144    html = '' 
    139145