ã¨ãããããã®å ´ã§åãã°okãªãã©ã°ã¤ã³ãæ¸ãã¦ã¿ãã
Tracã®ç°å¢ãä¸ã¤ç¨æãã¦ãTRAC_ADMINã®æ¨©éãè¨å®ãã¦ããã
ç¨æããTracç°å¢ã®pluginsãã£ã¬ã¯ããªã«ä»¥ä¸ã®hello.pyãä½æããã
from trac.core import * from trac.web.api import IRequestHandler class HelloPlugin(Component): implements(IRequestHandler) def match_request(self, req): return req.path_info.startswith('/hello') def process_request(self, req): req.send_response(200) req.send_header('Content-Type', 'text/plain') req.end_headers() req.write('hello')
ä½æãããtracã®ç°å¢ããªãã¼ããããmodwsgiãªãapacheã®åèµ·åãªã©ã
ãã©ã°ã¤ã³ç®¡çã®ç»é¢ãè¦ãã¨helloã追å ããã¦ããã
/hello ã«ã¢ã¯ã»ã¹ããã¨ã"hello"ã¨è¡¨ç¤ºãããã
åå©ç¨ãæ³å®ãããªãsetup.pyãæ¸ãããããã
ä»åã¯IRequestHandlerãimplementsãããã©ããã»ãã«ããããããªã¤ã³ã¿ã¼ãã§ã¼ã¹ãããã¾ãããã±ããã®ä½æãæ´æ°ã«ããã¯ããITicketChangeListenerãªããã¯çµæ§ä½¿ãã
ä¼ç¤¾ã§ã¯Tracã®ãã±ããã®ä½æå¤æ´éç¥ãskypebotãè¡ãããã«ãã©ã°ã¤ã³ãæ¸ãã¦ã¾ãã