<?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>ものぐさ備忘録 &#187; Python</title>
	<atom:link href="http://www.ginriki.net/wd/category/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ginriki.net/wd</link>
	<description>ソフトウェア関係の話を中心とした備忘録的日記</description>
	<lastBuildDate>Sun, 11 Jul 2010 15:48:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>rubyプロセスのコアファイルからバックトレースする。（おまけ: python）</title>
		<link>http://www.ginriki.net/wd/2009/11/09/80/</link>
		<comments>http://www.ginriki.net/wd/2009/11/09/80/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 22:00:34 +0000</pubDate>
		<dc:creator>ginriki</dc:creator>
				<category><![CDATA[FFI]]></category>
		<category><![CDATA[GDB]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[gdbscript]]></category>

		<guid isPermaLink="false">http://www.ginriki.net/wd/?p=80</guid>
		<description><![CDATA[某所で、「rubyプロセスがSEGVとかした時のコアファイルから、rubyスクリプトのバックトレースは取れるの？」って聞かれたので、ちょっと調べてみました。
結論としては、「rubyメソッドの呼び出し位置(ファイル名,  [...]]]></description>
			<content:encoded><![CDATA[<p>某所で、「rubyプロセスがSEGVとかした時のコアファイルから、rubyスクリプトのバックトレースは取れるの？」って聞かれたので、ちょっと調べてみました。</p>
<p>結論としては、「rubyメソッドの呼び出し位置(ファイル名, 行番号)は取れるけど、呼び出し時の実引数を見るのは難しい」っていう感じです。<br />
rubyのスタックフレームは、当然、rubyプロセスのメモリ上に構築されるので、スタックフレームのデータ構造さえわかれば、ある程度は表示できます。</p>
<p>ただ、コアファイルを出力したrubyプロセスはすでに存在しないので、ruby実装に使われているC関数をデバッガで（正確にはrubyプロセス上で）実行することができません。<br />
そのため、オブジェクトのinspectなどを実行することが難しく、実引数のオブジェクトが何か調べることが困難です。ということで、今回はスタックフレームを表示させる方法を以下で説明します。</p>
<p>rubyスタックフレームを表示するGDBスクリプトは以下になります(rb_dump.gdb)。<br />
(moriyoshiさんのブログ「<a href="http://d.hatena.ne.jp/moriyoshi/20070927/1190910311"> GDBで実行中のスクリプト言語のスタックフレームをダンプしてみる試み</a>」のコードをほとんどそのまま使わせていただきました。ありがとうございます。)</p>
<div class="igBar"><span id="lcode-4"><a href="#" onclick="javascript:showPlainTxt('code-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-4">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">define dump_rb_bt_from_core</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; set $t = ruby_frame</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; while $t</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; printf <span style="color:#CC0000;">"[0x%08x] "</span>, $t</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; if $t-&gt;<span style="">node</span>.<span style="">nd_file</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; printf <span style="color:#CC0000;">"(%s:%d)<span style="color:#000099; font-weight:bold;">\n</span>"</span>, $t-&gt;<span style="">node</span>.<span style="">nd_file</span>, <span style="color:#006600; font-weight:bold;">&#40;</span>$t-&gt;<span style="">node</span>.<span style="">flags</span>&gt;&gt; <span style="color:#800000;color:#800000;">19</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">1</span> &lt;&lt;<span style="color:#006600; font-weight:bold;">&#40;</span>sizeof<span style="color:#006600; font-weight:bold;">&#40;</span>NODE*<span style="color:#006600; font-weight:bold;">&#41;</span> * <span style="color:#800000;color:#800000;">8</span> - <span style="color:#800000;color:#800000;">19</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> - <span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; else</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; printf <span style="color:#CC0000;">"(UNKNOWN)<span style="color:#000099; font-weight:bold;">\n</span>"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; end</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; set $t = $t-&gt;<span style="">prev</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; end</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">end</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">document dump_rb_bt_from_core</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; dumps the current frame stack from core file. <span style="">usage</span>: dump_rb_bt_from_core</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">end </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>今回はサンプルプログラムとして、0アドレスにアクセスするC拡張ライブラリを実行するrubyスクリプトを用意します。<br />
まず、C拡張ライブラリ(segv.c)、</p>
<div class="igBar"><span id="lc-5"><a href="#" onclick="javascript:showPlainTxt('c-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">C:</span>
<div id="c-5">
<div class="c">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #339933;">#include &quot;ruby.h&quot;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">VALUE do_segv<span style="color: #66cc66;">&#40;</span>VALUE self<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; *<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">char</span>*<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span>0x0<span style="color: #66cc66;">&#41;</span> = <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> Qnil;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">void</span> Init_segv<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; VALUE module;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; module = rb_define_module<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Segv"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; rb_define_module_function<span style="color: #66cc66;">&#40;</span>module, <span style="color: #ff0000;">"do_segv"</span>, &amp;do_segv, <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
で、後は適当にextconf.rbを作って、segv.soを作ります。</p>
<p>次にsegv.soを呼び出すRubyスクリプト(test.rb)。</p>
<div class="igBar"><span id="lruby-6"><a href="#" onclick="javascript:showPlainTxt('ruby-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-6">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">require</span> 'segv'</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> test1<span style="color:#006600; font-weight:bold;">&#40;</span>a<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; test2<span style="color:#006600; font-weight:bold;">&#40;</span>a<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> test2<span style="color:#006600; font-weight:bold;">&#40;</span>b<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; Segv::do_segv</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">test1<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>さて、サンプルプログラムの用意ができたので、SEGVさせてみます。</p>
<pre>
$ ulimit -c unlimited
$ ruby test.rb
test.rb:8: [BUG] Segmentation fault
ruby 1.8.5 (2006-08-25) [i386-linux]

アボートしました (core dumped)
</pre>
<p>これでコアファイルが出力されたので、それをGDBで解析します。</p>
<p>今回はCentOS 5.3のyumでインストールしたrubyから出力されたコアファイルなので、<br />
GDBで解析するには、<a href="http://debuginfo.centos.org/">ここ</a>からrubyのdebuginfoをインストールしておく必要があります。</p>
<pre>
$ wget http://debuginfo.centos.org/5/i386/ruby-debuginfo-1.8.5-5.el5_3.7.i386.rpm
# rpm -i ruby-debuginfo-1.8.5-5.el5_3.7.i386.rpm
</pre>
<p>それでは、GDBでコアファイルからrubyのバックトレースをさせてみます。</p>
<pre>
$ gdb ruby core.29443
GNU gdb Fedora (6.8-37.el5)
...
(gdb) backtrace   #通常のC関数レベルのバックトレース。
#0  0x00b3a402 in __kernel_vsyscall ()
#1  0x0056fdf0 in raise () from /lib/libc.so.6
#2  0x00571701 in abort () from /lib/libc.so.6
#3  0x00c514c2 in rb_bug (fmt=<value optimized out>) at error.c:214
#4  0x00cbd80b in sigsegv (sig=<value optimized out>) at signal.c:537
#5  [signal handler called]
#6  do_segv (self=3086662140) at segv.c:4
#7  0x00c54dd5 in call_cfunc (...) at eval.c:5657
#8  0x00c5c4ab in rb_call0 (...) at eval.c:5810

(gdb) source rb_dump.gdb      #この記事の最初に作ったGDBスクリプトをロード
(gdb) dump_rb_bt_from_core  # rubyバックトレース
[0xbfc1da20] (test.rb:8)
[0xbfc1e0e0] (test.rb:4)
[0xbfc1e7c0] (test.rb:11)
[0x00d0f960] Cannot access memory at address 0x4
</pre>
<p>以上になります。</p>
<p>pythonもコアファイルからスタックフレームが取れるか調べてみましたが、<br />
<a href="http://wiki.python.org/moin/DebuggingWithGdb">DebuggingWithGDB</a>のgdbinitスクリプトを読む限り、<br />
rubyと同様に実行していたpythonスクリプトのファイル名と行番号は取れそうです。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ginriki.net/wd/2009/11/09/80/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PythonのインタラクティブモードでTab補完を使う</title>
		<link>http://www.ginriki.net/wd/2008/09/25/41/</link>
		<comments>http://www.ginriki.net/wd/2008/09/25/41/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 16:31:54 +0000</pubDate>
		<dc:creator>ginriki</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[interactive mode]]></category>
		<category><![CDATA[インタラクティブモード]]></category>

		<guid isPermaLink="false">http://www.gikogeek.net/wd/?p=41</guid>
		<description><![CDATA[昨日の記事の続き
このまま、各言語のインタラクティブモードの補完機能について書いてけば、
しばらくネタに困らないので続けよう。
今回はPythonです。
pythonの場合、引数なしで起動すればインタラクティブモードにな [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.gikogeek.net/wd/2008/09/24/40/'>昨日の記事</a>の続き</p>
<p>このまま、各言語のインタラクティブモードの補完機能について書いてけば、<br />
しばらくネタに困らないので続けよう。</p>
<p>今回はPythonです。</p>
<p>pythonの場合、引数なしで起動すればインタラクティブモードになりますが、<br />
下記のようにrlcompleterをimportすることで、補完機能が使えます。<br />
ただし、readlineライブラリが必要です。Linuxとかなら、yum install pythonで普通に入るようです。</p>
<div class="igBar"><span id="lpython-8"><a href="#" onclick="javascript:showPlainTxt('python-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PYTHON:</span>
<div id="python-8">
<div class="python">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$ python</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&gt;&gt;&gt; <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">rlcompleter</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&gt;&gt;&gt; <span style="color: #dc143c;">rlcompleter</span>.<span style="color: #dc143c;">readline</span>.<span style="color: black;">parse_and_bind</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'tab: complete'</span><span style="color: black;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&gt;&gt;&gt; di <span style="color: black;">&#91;</span>TAB<span style="color: black;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #008000;">dict</span>&nbsp; &nbsp; <span style="color: #008000;">dir</span>&nbsp; &nbsp; &nbsp;<span style="color: #008000;">divmod</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&gt;&gt;&gt; di </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Windowsの人は、<a href='http://newcenturycomputers.net/projects/readline.html'>Python Alternative Readline</a>をインストールするのが楽だと思います。</p>
<p>若干、通常のreadlineと挙動が違うのがアレですが・・・。</p>
<h4>参考サイト</h4>
<ul>
<li><a href='http://d.hatena.ne.jp/maedana/20070813/1186992559'>http://d.hatena.ne.jp/maedana/20070813/1186992559</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ginriki.net/wd/2008/09/25/41/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>tracプラグインとか</title>
		<link>http://www.ginriki.net/wd/2007/11/21/28/</link>
		<comments>http://www.ginriki.net/wd/2007/11/21/28/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 19:40:37 +0000</pubDate>
		<dc:creator>ginriki</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://www.gikogeek.net/wd/?p=28</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<div class="section">
<p>なぜか大学院の授業でtracのプラグインを作ることになった。</p>
<p>とりあえず<a href="http://trac-hacks.org/wiki/EggCookingTutorial/AdvancedEggCooking2" target="_blank">プラグインのtutorial</a>を見てたら、プラグインが表示するHTML用テンプレートの記述に "include header.cs"みたいなのを発見。</p>
<p>csファイル<span class="footnote"><a href="/gikogeek/#f1" name="fn1" title="C#のソースファイルではありません">*1</a></span>ってなんだよと思って調べてみたらClearSilverの略だと判明。</p>
<p><a href="http://discypus.jp/wiki/?%A5%BD%A5%D5%A5%C8/Bug%20Tracking/trac" target="_blank">http://discypus.jp/wiki/?%A5%BD%A5%D5%A5%C8/Bug%20Tracking/trac</a>を見たところ、</p>
<ul>
<li> trac0.10 まではテンプレートエンジンとしてClearSilverを使ってる。ClearSilverはC言語で書かれている</li>
<li> trac0.11からはPythonで書かれているGenshiをテンプレートエンジンとして使う
<ul>
<li> ClearSilverがコンパイルできないような環境でもtracが使えるようにするため</li>
<li> ただ、これまでのプラグインも動作させるため、trac0.11でもClearSilverは使えるらしい</li>
</ul>
</li>
</ul>
<p>ということらしい。</p>
<p>ClearSilverとGenshiの記述上の違いは以下のサイトが参考になりそう。</p>
<p><a href="http://trac.edgewall.org/wiki/TracDev/PortingFromClearSilverToGenshi" target="_blank">http://trac.edgewall.org/wiki/TracDev/PortingFromClearSilverToGenshi</a></p>
</div>
<div class="footnote">
<p class="footnote"><a href="/gikogeek/#fn1" name="f1">*1</a>：C#のソースファイルではありません</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.ginriki.net/wd/2007/11/21/28/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
