<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>mizzy.org: Trac &#12398; SearchHyperEstraierPlugin &#12434; Trac 0.10.x &#12391;&#21205;&#12363;&#12377;&#12497;&#12483;&#12481;</title>
    <link>http://blog.mizzy.org/articles/2007/08/09/SearchHyperEstraierPlugin</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Trac &#12398; SearchHyperEstraierPlugin &#12434; Trac 0.10.x &#12391;&#21205;&#12363;&#12377;&#12497;&#12483;&#12481;</title>
      <description>&lt;p&gt;&lt;a href="http://weekbuild.sakura.ne.jp/trac/wiki/TracDoc/SearchHyperEstraierPlugin"&gt;SearchHyperEstraierPlugin&lt;/a&gt; &#12364;&#12289;Trac 0.10.x &#12392;&#12356;&#12358;&#12363;&#12289;&#12358;&#12385;&#12398;&#29872;&#22659;&#12391;&#21205;&#12363;&#12394;&#12356;&#12398;&#12391;&#12289;&#12497;&#12483;&#12481;&#26360;&#12356;&#12383;&#12290;&#21021; Python &#12503;&#12525;&#12464;&#12521;&#12511;&#12531;&#12464;&#12290;&#65288;&#12392;&#12356;&#12358;&#12411;&#12393;&#12398;&#12418;&#12398;&#12376;&#12419;&#12394;&#12356;&#12369;&#12393;&#12290;&#65289;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
=== searchhyperestraier/searchhyperestraier.py
==================================================================
--- searchhyperestraier/searchhyperestraier.py    (revision 892)
+++ searchhyperestraier/searchhyperestraier.py    (local)
@@ -2,8 +2,9 @@
 # SearchRepositoryWithNamazu plugin

 from trac.core import *
-from trac.Search import ISearchSource, query_to_sql, shorten_result
+from trac.Search import ISearchSource, shorten_result
 from trac.util import NaivePopen
+from trac.util.text import to_unicode
 from StringIO import StringIO
 import urllib
 import time
@@ -44,9 +45,9 @@
         browse_trac = self.env.config.get('searchhyperestraier', 'browse_trac','enabled')

-        cmdline = "%s %s %s %s" % (estcmd_path,estcmd_arg,index_path,unicode(query,'utf-8').encode(estcmd_encode))
+        cmdline = "%s %s %s %s" % (estcmd_path,estcmd_arg,index_path,' '.join(query))
         self.log.debug('SearchHyperEstraier:%s' % cmdline)
-        np = NaivePopen(cmdline)
+        np = NaivePopen( cmdline.encode(estcmd_encode) )
         #self.log.debug('Result:%s' % unicode(np.out,'utf-8').encode('mbcs'))
         #self.log.debug('Result:%s' % np.out)
         if np.errorlevel or np.err:
@@ -74,7 +75,7 @@
             attrelem_array = element.getElementsByTagName("attribute")
             for attrelem in attrelem_array:
                 attr_name = attrelem.getAttribute("name")
-                attr_value = unicode(attrelem.getAttribute("value")).encode('utf-8')
+                attr_value = to_unicode(attrelem.getAttribute("value"))
                 #URL&#12392;&#12479;&#12452;&#12488;&#12523;&#12434;&#29983;&#25104;
                 if attr_name == "_lreal":
                     attr_value=attr_value[len(replace_left):].replace("\\","/")
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;&#12456;&#12521;&#12540;&#12364;&#20986;&#12427;&#12383;&#12403;&#12395;&#12289;&#36969;&#24403;&#12395;&#12356;&#12376;&#12387;&#12390;&#12383;&#12425;&#21205;&#12356;&#12383;&#12289;&#12392;&#12356;&#12358;&#24863;&#12376;&#12290;&#12394;&#12398;&#12391;&#12289;&#12371;&#12435;&#12394;&#12435;&#12391;&#12356;&#12356;&#12398;&#12363;&#12399;&#12424;&#12367;&#20998;&#12363;&#12425;&#12394;&#12356;&#12290;&lt;/p&gt;</description>
      <pubDate>Thu, 09 Aug 2007 03:03:00 +0900</pubDate>
      <guid isPermaLink="false">urn:uuid:caf9c890-84e5-43df-baec-aa809c1324ce</guid>
      <author>Gosuke Miyashita</author>
      <link>http://blog.mizzy.org/articles/2007/08/09/SearchHyperEstraierPlugin</link>
      <category>program</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
