<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Notes of a Developer &#187; Trac</title>
	<atom:link href="http://www.developers-life.com/tag/trac/feed" rel="self" type="application/rss+xml" />
	<link>http://www.developers-life.com</link>
	<description>Develop on Objective-C, UIKit, C, OpenGL for  iPhone, iPad, Mac OS X</description>
	<lastBuildDate>Fri, 03 Feb 2012 11:49:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Тикеты по всем проектам в Trac`e</title>
		<link>http://www.developers-life.com/macros-for-trac-all-tickets-by-all-projects.html</link>
		<comments>http://www.developers-life.com/macros-for-trac-all-tickets-by-all-projects.html#comments</comments>
		<pubDate>Thu, 11 Sep 2008 20:50:38 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Trac]]></category>
		<category><![CDATA[Macros]]></category>

		<guid isPermaLink="false">http://www.developers-life.com/?p=132</guid>
		<description><![CDATA[Выкладываю свой Macros для трака. Это переписанный макрос, который отображал тикеты по выбранному проекту в виде календаря. На данный момент этот макрос выводит в список все активные тикеты по всем проектам, зашедшего в систему человека, и сортирует их по важности. В этом макросе есть возможность отследить время закрытия/создание/изменение тикетов по дате и по определенному человеку. [...]]]></description>
			<content:encoded><![CDATA[<p>Выкладываю свой Macros для трака. Это переписанный макрос, который отображал тикеты по выбранному проекту в виде календаря.</p>
<p>На данный момент этот макрос выводит в список все активные тикеты по всем проектам, зашедшего в систему человека, и сортирует их по важности. В этом макросе есть возможность отследить время закрытия/создание/изменение тикетов по дате и по определенному человеку.</p>
<p>Код макроса:<br />
<span id="more-132"></span></p>
<div class="codecolorer-container python geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br />139<br />140<br />141<br />142<br />143<br />144<br />145<br />146<br />147<br />148<br />149<br />150<br />151<br />152<br />153<br />154<br />155<br />156<br />157<br />158<br />159<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;"># Author: Vladimir Boichentsov </span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">calendar</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">string</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">Cookie</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">fileinput</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> sqlite3 <span style="color: #ff7700;font-weight:bold;">as</span> sqlite<br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">operator</span><br />
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">StringIO</span> <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">StringIO</span><br />
<span style="color: #ff7700;font-weight:bold;">from</span> trac.<span style="color: black;">wiki</span>.<span style="color: black;">api</span> <span style="color: #ff7700;font-weight:bold;">import</span> WikiSystem<br />
<span style="color: #ff7700;font-weight:bold;">from</span> trac.<span style="color: black;">util</span> <span style="color: #ff7700;font-weight:bold;">import</span> *<br />
<br />
<br />
<br />
<span style="color: #ff7700;font-weight:bold;">def</span> execute<span style="color: black;">&#40;</span>hdf<span style="color: #66cc66;">,</span> txt<span style="color: #66cc66;">,</span> env<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># building the output</span><br />
&nbsp; &nbsp; buff <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">StringIO</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># you type ticket</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>hdf.<span style="color: black;">getValue</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'args.close'</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'no'</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">==</span> <span style="color: #483d8b;">&quot;yes&quot;</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp;plist <span style="color: #66cc66;">=</span> <span style="color: black;">&#91;</span><span style="color: #483d8b;">'none'</span><span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp;plist <span style="color: #66cc66;">=</span> <span style="color: black;">&#91;</span><span style="color: #483d8b;">'blocker'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'critical'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'high'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'major'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'medium'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'minor'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'trivial'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'low'</span><span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; tickets <span style="color: #66cc66;">=</span> <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># directory by trac projects</span><br />
&nbsp; &nbsp; DIR <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">'/home/pub/trac'</span><br />
&nbsp; &nbsp; o <span style="color: #66cc66;">=</span> j <span style="color: #66cc66;">=</span> c <span style="color: #66cc66;">=</span> <span style="color: #ff4500;">0</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; users <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">''</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">#passwords for users trac projects</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> line <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">fileinput</span>.<span style="color: #008000;">input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'/home/pub/svn/.htpasswd'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp;temp <span style="color: #66cc66;">=</span> line.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">':'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>temp<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">!=</span> <span style="color: #483d8b;">'admin'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;users +<span style="color: #66cc66;">=</span> <span style="color: #483d8b;">'&lt;a href=&quot;?user='</span> + temp<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> + <span style="color: #483d8b;">'&quot;&gt;'</span> + temp<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> + <span style="color: #483d8b;">'&lt;/a&gt; &amp;nbsp;'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #dc143c;">user</span> <span style="color: #66cc66;">=</span> hdf.<span style="color: black;">getValue</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'args.user'</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">''</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">user</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">&lt;</span> <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; owner <span style="color: #66cc66;">=</span> hdf.<span style="color: black;">getValue</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;trac.authname&quot;</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">&quot;anonymous&quot;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; owner <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">user</span><br />
<br />
&nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'&lt;a href=&quot;?user='</span> + owner + <span style="color: #483d8b;">'&amp;close=yes&amp;time=yes&quot;&gt;close(create time)&lt;/a&gt; &lt;a href=&quot;?user='</span> + owner + <span style="color: #483d8b;">'&amp;close=yes&quot;&gt;close(time close)&lt;/a&gt; | '</span> + users + <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'&lt;table class=&quot;listing tickets&quot;&gt;&lt;tbody&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'&lt;thead&gt;&lt;tr&gt; &lt;td class=&quot;ticket&quot;&gt; Ticket &lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;summary&quot;&gt;Summary&lt;/td&gt; &lt;td&gt; Project&lt;/td&gt; &nbsp;&lt;td class=&quot;owner&quot;&gt;Owner&lt;/td&gt; &lt;td&gt;Priority&lt;/td&gt; &lt;td&gt;Type&lt;/td&gt; &lt;td class=&quot;date&quot;&gt; Create &lt;/td&gt; &lt;td class=&quot;date&quot;&gt; Changetime &lt;/td&gt; &lt;/tr&gt; &lt;/thead&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> p <span style="color: #ff7700;font-weight:bold;">in</span> plist:<br />
&nbsp; &nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">for</span> project <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">listdir</span><span style="color: black;">&#40;</span>DIR<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;con <span style="color: #66cc66;">=</span> sqlite.<span style="color: black;">connect</span><span style="color: black;">&#40;</span>DIR + <span style="color: #483d8b;">'/'</span> + project +<span style="color: #483d8b;">'/db/trac.db'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cur <span style="color: #66cc66;">=</span> con.<span style="color: black;">cursor</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>p <span style="color: #66cc66;">!=</span> <span style="color: #483d8b;">'none'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;t <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">&quot;and t.priority='&quot;</span> + p + <span style="color: #483d8b;">&quot;'&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;t <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">''</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cur.<span style="color: black;">execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;SELECT t.changetime,t.id,t.summary,t.owner,t.status,t.description,t.time,t.priority,t.type FROM ticket t, ticket_custom tc where tc.ticket=t.id and t.owner='&quot;</span> + owner +<span style="color: #483d8b;">&quot;' &quot;</span> + t<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>hdf.<span style="color: black;">getValue</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'args.close'</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'no'</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">!=</span> <span style="color: #483d8b;">&quot;yes&quot;</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; row <span style="color: #66cc66;">=</span> cur.<span style="color: black;">fetchone</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> row <span style="color: #66cc66;">==</span> <span style="color: #008000;">None</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">break</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;j <span style="color: #66cc66;">=</span> j + <span style="color: #ff4500;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">4</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">!=</span> <span style="color: #483d8b;">'closed'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;o <span style="color: #66cc66;">=</span> o + <span style="color: #ff4500;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c <span style="color: #66cc66;">=</span> c + <span style="color: #ff4500;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">4</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">!=</span> <span style="color: #483d8b;">'closed'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span>show_ticket<span style="color: black;">&#40;</span>row<span style="color: #66cc66;">,</span>project<span style="color: #66cc66;">,</span>env<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">while</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; row <span style="color: #66cc66;">=</span> cur.<span style="color: black;">fetchone</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ticket <span style="color: #66cc66;">=</span> <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> row <span style="color: #66cc66;">==</span> <span style="color: #008000;">None</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">break</span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> t <span style="color: #ff7700;font-weight:bold;">in</span> row:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ticket.<span style="color: black;">append</span><span style="color: black;">&#40;</span>t<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ticket.<span style="color: black;">append</span><span style="color: black;">&#40;</span>project<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tickets.<span style="color: black;">append</span><span style="color: black;">&#40;</span>ticket<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>hdf.<span style="color: black;">getValue</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'args.close'</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'no'</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">==</span> <span style="color: #483d8b;">&quot;yes&quot;</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>hdf.<span style="color: black;">getValue</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'args.time'</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'no'</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">==</span> <span style="color: #483d8b;">&quot;yes&quot;</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tickets.<span style="color: black;">sort</span><span style="color: black;">&#40;</span>reverse<span style="color: #66cc66;">=</span><span style="color: #008000;">True</span><span style="color: #66cc66;">,</span>key<span style="color: #66cc66;">=</span><span style="color: #dc143c;">operator</span>.<span style="color: black;">itemgetter</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tickets.<span style="color: black;">sort</span><span style="color: black;">&#40;</span>reverse<span style="color: #66cc66;">=</span><span style="color: #008000;">True</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> row <span style="color: #ff7700;font-weight:bold;">in</span> tickets:<br />
&nbsp; &nbsp; &nbsp;buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span>show_ticket<span style="color: black;">&#40;</span>row<span style="color: #66cc66;">,</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">9</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span>env<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp;j <span style="color: #66cc66;">=</span> j + <span style="color: #ff4500;">1</span><br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">4</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">!=</span> <span style="color: #483d8b;">'closed'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;o <span style="color: #66cc66;">=</span> o + <span style="color: #ff4500;">1</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c <span style="color: #66cc66;">=</span> c + <span style="color: #ff4500;">1</span><br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'&lt;/tbody&gt;&lt;/table&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'&lt;br&gt;Ticket all: %(j)i Ticket open: %(o)i &nbsp;Closed ticket: %(c)i <span style="color: #000099; font-weight: bold;">\n</span>'</span> % <span style="color: black;">&#123;</span> <span style="color: #483d8b;">'j'</span>:j<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">'o'</span>:o<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">'c'</span>:c<span style="color: #66cc66;">,</span> <span style="color: black;">&#125;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; table <span style="color: #66cc66;">=</span> buff.<span style="color: black;">getvalue</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; buff.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> table<br />
<br />
<br />
<span style="color: #ff7700;font-weight:bold;">def</span> ticket_priority<span style="color: black;">&#40;</span>row<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; priority <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">''</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">7</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">==</span> <span style="color: #483d8b;">'minor'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp;priority <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">&quot;background: #e7ffff; border-color: #cee; color: #099;&quot;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">7</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">==</span> <span style="color: #483d8b;">'major'</span> <span style="color: #ff7700;font-weight:bold;">or</span> row<span style="color: black;">&#91;</span><span style="color: #ff4500;">7</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">==</span> <span style="color: #483d8b;">'medium'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; priority <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">&quot;background: #fbfbfb; border-color: #ddd; color: #444;&quot;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">7</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">==</span> <span style="color: #483d8b;">'trivial'</span> <span style="color: #ff7700;font-weight:bold;">or</span> row<span style="color: black;">&#91;</span><span style="color: #ff4500;">7</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">==</span> <span style="color: #483d8b;">'low'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; priority <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">&quot;background: #e7eeff; border-color: #cde; color: #469;&quot;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">7</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">==</span> <span style="color: #483d8b;">'critical'</span> <span style="color: #ff7700;font-weight:bold;">or</span> row<span style="color: black;">&#91;</span><span style="color: #ff4500;">7</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">==</span> <span style="color: #483d8b;">'high'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; priority <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">&quot;background: #ffb; border-color: #eea; color: #880;&quot;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">7</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">==</span> <span style="color: #483d8b;">'blocker'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; priority <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">&quot;background: #fdc; border-color: #e88; color: #a22;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">4</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">==</span> <span style="color: #483d8b;">'closed'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; priority <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">&quot;color: #777; background: #ddd; border-color: #ccc;&quot;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> priority<br />
<br />
&nbsp; &nbsp; &nbsp;<br />
<span style="color: #ff7700;font-weight:bold;">def</span> show_ticket<span style="color: black;">&#40;</span>row<span style="color: #66cc66;">,</span>project<span style="color: #66cc66;">,</span>env<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; ticket <span style="color: #66cc66;">=</span> row<span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; line <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">'&lt;tr style=&quot;%(priority)s&quot;&gt; &lt;td class=&quot;ticket&quot;&gt; &lt;a href=&quot;/trac/%(project)s/ticket/%(id)i&quot;&gt; #%(id)i &lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;summary&quot;&gt;&lt;a href=&quot;/trac/%(project)s/ticket/%(id)i&quot; title=&quot;%(description)s&quot;&gt; %(ticket)s &lt;/a&gt;&lt;/td&gt;&lt;td&gt;%(project)s&lt;/td&gt; &nbsp;&lt;td class=&quot;owner&quot;&gt;%(owner)s&lt;/td&gt; &lt;td&gt;%(prio)s&lt;/td&gt; &lt;td&gt;%(type)s&lt;/td&gt; &lt;td class=&quot;date&quot;&gt; %(time)s &lt;/td&gt; &lt;td class=&quot;date&quot;&gt; %(changetime)s &lt;/td&gt; &lt;/tr&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span> % <span style="color: black;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">'id'</span> : row<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">'url'</span>: env.<span style="color: black;">href</span>.<span style="color: black;">ticket</span><span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">'project'</span> : project<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">'priority'</span> : ticket_priority<span style="color: black;">&#40;</span>row<span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">'prio'</span> : row<span style="color: black;">&#91;</span><span style="color: #ff4500;">7</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">'type'</span> : row<span style="color: black;">&#91;</span><span style="color: #ff4500;">8</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">'ticket'</span>: ticket<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span>:<span style="color: #ff4500;">100</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">'owner'</span>: row<span style="color: black;">&#91;</span><span style="color: #ff4500;">3</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">'time'</span> : <span style="color: #dc143c;">time</span>.<span style="color: black;">strftime</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'%d/%m/%y'</span><span style="color: #66cc66;">,</span><span style="color: #dc143c;">time</span>.<span style="color: black;">localtime</span><span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">6</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">'changetime'</span> : &nbsp; &nbsp; &nbsp;<span style="color: #dc143c;">time</span>.<span style="color: black;">strftime</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'%d/%m/%y'</span><span style="color: #66cc66;">,</span><span style="color: #dc143c;">time</span>.<span style="color: black;">localtime</span><span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">'style'</span>: row<span style="color: black;">&#91;</span><span style="color: #ff4500;">4</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">==</span> <span style="color: #483d8b;">'closed'</span> <span style="color: #ff7700;font-weight:bold;">and</span> <span style="color: #483d8b;">'font-size: 9px; color: #777777; text-decoration: line-through;'</span> <span style="color: #ff7700;font-weight:bold;">or</span> <span style="color: #483d8b;">'font-size: 9px; color: #000000'</span><span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #483d8b;">'description'</span>: <span style="color: #483d8b;">&quot; &quot;</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">#replace(description, &quot;\'&quot;, &quot;&amp;#39;&quot;) == None and &quot; &quot; or replace(description, &quot;\'&quot;, &quot;&amp;#39;&quot;),</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> line</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/macros-for-trac-all-tickets-by-all-projects.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Делаем RSS ленту всех проектов Trac`a</title>
		<link>http://www.developers-life.com/making-rss-tape-all-projects-trac-a.html</link>
		<comments>http://www.developers-life.com/making-rss-tape-all-projects-trac-a.html#comments</comments>
		<pubDate>Thu, 11 Sep 2008 20:36:11 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Trac]]></category>
		<category><![CDATA[RSS]]></category>

		<guid isPermaLink="false">http://www.developers-life.com/?p=131</guid>
		<description><![CDATA[Написал небольшой скрипт на python. Для получения RSS ленты по всем проектам trac системы, что иногда очень полезно. Это оценил мой менеджер проектов как удобное средство. Вот привожу на вольный суд. Чтоб получить ленту пишем http://192.168.0.129/index.py?user= md5( хеш пароля) Тоесть уже захешированый пароль еще в md5 Код: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100# Author: Vladimir Boichentsov &#60;sakrist@sakrist.org.ua&#62; import time import [...]]]></description>
			<content:encoded><![CDATA[<p>Написал небольшой скрипт на python. Для получения RSS ленты по всем проектам trac системы, что иногда очень полезно. Это оценил мой менеджер проектов как удобное средство. Вот привожу на вольный суд.</p>
<p>Чтоб получить ленту пишем http://192.168.0.129/index.py?user= md5( хеш пароля)<br />
Тоесть уже захешированый пароль еще в md5<br />
Код:<br />
<span id="more-131"></span></p>
<div class="codecolorer-container python geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;"># Author: Vladimir Boichentsov &lt;sakrist@sakrist.org.ua&gt;</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">calendar</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">string</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">Cookie</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">fileinput</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> sqlite3 <span style="color: #ff7700;font-weight:bold;">as</span> sqlite<br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">cgi</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">base64</span><br />
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">md5</span> <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">md5</span><br />
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">StringIO</span> <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">StringIO</span><br />
<br />
<br />
<br />
<span style="color: #ff7700;font-weight:bold;">def</span> &nbsp;index<span style="color: black;">&#40;</span>req<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># building the output</span><br />
&nbsp; &nbsp; buff <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">StringIO</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># you type ticket</span><br />
&nbsp; &nbsp; plist <span style="color: #66cc66;">=</span> <span style="color: black;">&#91;</span><span style="color: #483d8b;">'blocker'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'critical'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'high'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'major'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'medium'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'minor'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'trivial'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">'low'</span><span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># directory by trac projects</span><br />
&nbsp; &nbsp; DIR <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">'/home/pub/trac'</span><br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># adress trac projects</span><br />
&nbsp; &nbsp; url <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">'http://192.168.0.129/trac'</span><br />
&nbsp; &nbsp; i <span style="color: #66cc66;">=</span> <span style="color: #ff4500;">0</span><br />
&nbsp; &nbsp; owner <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">' '</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> req.<span style="color: black;">form</span>.<span style="color: black;">has_key</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'user'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #dc143c;">user</span> <span style="color: #66cc66;">=</span> req.<span style="color: black;">form</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'user'</span><span style="color: black;">&#93;</span>.<span style="color: black;">value</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">#passwords for users trac projects</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> line <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">fileinput</span>.<span style="color: #008000;">input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'/home/pub/.htpasswd'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; line <span style="color: #66cc66;">=</span> line.<span style="color: black;">replace</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #66cc66;">,</span><span style="color: #483d8b;">''</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; temp <span style="color: #66cc66;">=</span> line.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">':'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">md5</span><span style="color: black;">&#40;</span>line<span style="color: black;">&#41;</span>.<span style="color: black;">hexdigest</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">==</span> <span style="color: #dc143c;">user</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; owner <span style="color: #66cc66;">=</span> temp<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> owner <span style="color: #66cc66;">!=</span> <span style="color: #483d8b;">' '</span> :<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'&lt;?xml version=&quot;1.0&quot;?&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'&lt;rss version=&quot;2.0&quot;&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'&lt;channel&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span>&lt;title&gt;All My Tickets&lt;/title&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span>&lt;link&gt;'</span> + url + <span style="color: #483d8b;">'/org/wiki/AllTikets&lt;/link&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span>&lt;description&gt;Trac Report - All My Tickets&lt;/description&gt;'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span>&lt;language&gt;en-us&lt;/language&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span>&lt;generator&gt;RSS SAKrisT&lt;/generator&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span>&lt;image&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span>&lt;title&gt;Organizational&lt;/title&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span>&lt;url&gt;'</span> + url + <span style="color: #483d8b;">'_banner.png&lt;/url&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span>&lt;link&gt;'</span> + url + <span style="color: #483d8b;">'/org/wiki/AllTikets&lt;/link&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span>&lt;/image&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> p <span style="color: #ff7700;font-weight:bold;">in</span> plist:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> project <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">listdir</span><span style="color: black;">&#40;</span>DIR<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span>i <span style="color: #66cc66;">==</span> <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; con <span style="color: #66cc66;">=</span> sqlite.<span style="color: black;">connect</span><span style="color: black;">&#40;</span>DIR + <span style="color: #483d8b;">'/'</span> + project +<span style="color: #483d8b;">'/db/trac.db'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cur <span style="color: #66cc66;">=</span> con.<span style="color: black;">cursor</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cur.<span style="color: black;">execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;SELECT t.id,t.summary,t.owner,t.status,t.description,t.time,t.priority,t.type FROM ticket t, ticket_custom tc where tc.ticket=t.id and t.owner='&quot;</span> + owner +<span style="color: #483d8b;">&quot;' and t.priority='&quot;</span> + p &nbsp;+ <span style="color: #483d8b;">&quot;'&quot;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; row <span style="color: #66cc66;">=</span> cur.<span style="color: black;">fetchone</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> row <span style="color: #66cc66;">==</span> <span style="color: #008000;">None</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">break</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; status <span style="color: #66cc66;">=</span> row<span style="color: black;">&#91;</span><span style="color: #ff4500;">3</span><span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; description <span style="color: #66cc66;">=</span> row<span style="color: black;">&#91;</span><span style="color: #ff4500;">4</span><span style="color: black;">&#93;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; description <span style="color: #66cc66;">=</span> description.<span style="color: black;">replace</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'[[BR]]'</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'&amp;lt;br&amp;gt;'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; description <span style="color: #66cc66;">=</span> description.<span style="color: black;">replace</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'&lt;'</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'&amp;lt;'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; description <span style="color: #66cc66;">=</span> description.<span style="color: black;">replace</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'&gt;'</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'&amp;gt;'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; timee <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">time</span>.<span style="color: black;">strftime</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'%d %m %Y %H:%M:%S GMT'</span><span style="color: #66cc66;">,</span><span style="color: #dc143c;">time</span>.<span style="color: black;">localtime</span><span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">5</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">3</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">!=</span> <span style="color: #483d8b;">'closed'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span>&lt;item&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>&lt;author&gt;'</span> + owner + <span style="color: #483d8b;">'&lt;/author&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>&lt;pubDate&gt;'</span> + timee &nbsp;+ <span style="color: #483d8b;">'&lt;/pubDate&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>&lt;title&gt;'</span> + row<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span> &nbsp;+ <span style="color: #483d8b;">'&lt;/title&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>&lt;link&gt;%(url)s/%(p)s/ticket/%(id)i&lt;/link&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span> % <span style="color: black;">&#123;</span><span style="color: #483d8b;">'id'</span> : row<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'p'</span> : project<span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'url'</span> : url<span style="color: #66cc66;">,</span> <span style="color: black;">&#125;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>&lt;guid isPermaLink=&quot;false&quot;&gt;%(url)s/%(p)s/ticket/%(id)i&lt;/guid&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span> % <span style="color: black;">&#123;</span><span style="color: #483d8b;">'id'</span> : row<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'p'</span> : project<span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'url'</span> : url<span style="color: #66cc66;">,</span> <span style="color: black;">&#125;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>&lt;description&gt;'</span> + description +<span style="color: #483d8b;">'&lt;/description&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>&lt;category&gt;Report&lt;/category&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\t</span>&lt;/item&gt;<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'&lt;/channel&gt;<span style="color: #000099; font-weight: bold;">\n</span>&lt;/rss&gt;'</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; table <span style="color: #66cc66;">=</span> buff.<span style="color: black;">getvalue</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buff.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> table<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">'error'</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/making-rss-tape-all-projects-trac-a.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Admin Permissions for Trac 0.10</title>
		<link>http://www.developers-life.com/web-admin-permissions-for-trac-010.html</link>
		<comments>http://www.developers-life.com/web-admin-permissions-for-trac-010.html#comments</comments>
		<pubDate>Wed, 03 Sep 2008 17:11:11 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Trac]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://developers-life.com/?p=14</guid>
		<description><![CDATA[Плагин для управления правами доступа пользователей (Web Admin Permissions)  WebAdminPerm совмести с Trac 0.10. Легок в установке и настройке. В версии трака Trac 0.11dev это реализовано, но так-как это dev версия она не стабильна, а этот плагин полноценно заменяет возможности управления правами. Установив плагин нужно указать в trac.ini в секци [components] следующую строку: webadminperm.perm.permissionadminpage = [...]]]></description>
			<content:encoded><![CDATA[<p>Плагин для управления правами доступа пользователей (Web Admin Permissions)  <a href="http://sakrist.org.ua/userfiles/webadminperm.tar">WebAdminPerm</a> совмести с Trac 0.10. Легок в установке и настройке.</p>
<p>В версии трака Trac 0.11dev это реализовано, но так-как это dev версия она не стабильна, а этот плагин полноценно заменяет возможности управления правами.</p>
<p>Установив плагин нужно указать в trac.ini в секци [components] следующую строку:<br />
webadminperm.perm.permissionadminpage = enabled<br />
<span id="more-14"></span><br />
В данные момент разработка плагина приостановлена.</p>
<p>Скриншот в действии:</p>
<p><img src="http://sakrist.org.ua/userfiles/xp3.jpg" alt="Trac Permission" width="733" height="384" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/web-admin-permissions-for-trac-010.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

