<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: please help me edit this xchat python script</title>
	<atom:link href="http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/</link>
	<description>Ali Ebrahim on web standards, software developement, technology, politics and law.</description>
	<pubDate>Sat, 22 Nov 2008 00:13:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Adam Roben</title>
		<link>http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/#comment-24</link>
		<dc:creator>Adam Roben</dc:creator>
		<pubDate>Fri, 09 Jul 2004 12:45:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/#comment-24</guid>
		<description>The only problem with that updated script is that it doesn't accept "bug  20000" (with two spaces) as a bug reference.  When chatting it's very easy to insert extra spaces, but the new script will only match one space (unlike the original which accepted any number of spaces, including 0).  But it does fix the recursion problem, so I guess that's a step forward.
</description>
		<content:encoded><![CDATA[<p>The only problem with that updated script is that it doesn&#8217;t accept &#8220;bug  20000&#8243; (with two spaces) as a bug reference.  When chatting it&#8217;s very easy to insert extra spaces, but the new script will only match one space (unlike the original which accepted any number of spaces, including 0).  But it does fix the recursion problem, so I guess that&#8217;s a step forward.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ali Ebrahim</title>
		<link>http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/#comment-23</link>
		<dc:creator>Ali Ebrahim</dc:creator>
		<pubDate>Thu, 08 Jul 2004 01:29:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/#comment-23</guid>
		<description>Thanks everyone. It was the recursion that was the problem. The script author actually provided me with an updated version with a fix, and what he did was just have it output something like:

"bug&#160;&#160;20000 (http://bugzilla.mozilla.org/show_bug.cgi?id=20000)"

(with two spaces between bug and the number).

You can find his updated version of the script &lt;a href="http://blog.ebrahim.org/media/bugzilla-1.py" rel="nofollow"&gt;here&lt;/a&gt;.
</description>
		<content:encoded><![CDATA[<p>Thanks everyone. It was the recursion that was the problem. The script author actually provided me with an updated version with a fix, and what he did was just have it output something like:</p>
<p>&#8220;bug&nbsp;&nbsp;20000 (http://bugzilla.mozilla.org/show_bug.cgi?id=20000)&#8221;</p>
<p>(with two spaces between bug and the number).</p>
<p>You can find his updated version of the script <a href="http://blog.ebrahim.org/media/bugzilla-1.py" rel="nofollow">here</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: [ct]</title>
		<link>http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/#comment-22</link>
		<dc:creator>[ct]</dc:creator>
		<pubDate>Wed, 07 Jul 2004 05:36:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/#comment-22</guid>
		<description>Perhaps you could put formatting around it (e.g. put the bug text in bold) and then match every bug link that isn't preceded by a bold formatting character...
</description>
		<content:encoded><![CDATA[<p>Perhaps you could put formatting around it (e.g. put the bug text in bold) and then match every bug link that isn&#8217;t preceded by a bold formatting character&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Roben</title>
		<link>http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/#comment-21</link>
		<dc:creator>Adam Roben</dc:creator>
		<pubDate>Wed, 07 Jul 2004 04:25:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/#comment-21</guid>
		<description>The problem seems to be (for me at least) that when you output "bug 20000 (http://bugzilla.mozilla.org/show_bug.cgi?id=20000)" this string gets run through all of your scripts again.  So since the replacement string contains "bug 20000" the script gets called again, and again, and again, putting XChat in an infinite loop and causing a segfault.  I don't know if there's a way to tell XChat not to run scripts on the output string (and you probably wouldn't want to since then you couldn't click on the URL), but a solution is to change BUGZILLA_URL to this:

BUGZILLA_URL = lambda num: "bugg " + num.group(1) + " (http://bugzilla.mozilla.org/show_bug.cgi?id=" + num.group(1) + ")"

Notice the "bugg" rather than "bug"  Now you get "bugg 20000 " so the script is not triggered again.  Of course, you can change this however you want ("bug! 20000" or "bug...20000", or anything that doesn't match your regexp).  Hope this helps.
</description>
		<content:encoded><![CDATA[<p>The problem seems to be (for me at least) that when you output &#8220;bug 20000 (http://bugzilla.mozilla.org/show_bug.cgi?id=20000)&#8221; this string gets run through all of your scripts again.  So since the replacement string contains &#8220;bug 20000&#8243; the script gets called again, and again, and again, putting XChat in an infinite loop and causing a segfault.  I don&#8217;t know if there&#8217;s a way to tell XChat not to run scripts on the output string (and you probably wouldn&#8217;t want to since then you couldn&#8217;t click on the URL), but a solution is to change BUGZILLA_URL to this:</p>
<p>BUGZILLA_URL = lambda num: &#8220;bugg &#8221; + num.group(1) + &#8221; (http://bugzilla.mozilla.org/show_bug.cgi?id=&#8221; + num.group(1) + &#8220;)&#8221;</p>
<p>Notice the &#8220;bugg&#8221; rather than &#8220;bug&#8221;  Now you get &#8220;bugg 20000 &#8221; so the script is not triggered again.  Of course, you can change this however you want (&#8221;bug! 20000&#8243; or &#8220;bug&#8230;20000&#8243;, or anything that doesn&#8217;t match your regexp).  Hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ali Ebrahim</title>
		<link>http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/#comment-20</link>
		<dc:creator>Ali Ebrahim</dc:creator>
		<pubDate>Wed, 07 Jul 2004 00:38:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/#comment-20</guid>
		<description>Hmm, this last suggestion actually crashes my XChat. Thanks for trying, though.
</description>
		<content:encoded><![CDATA[<p>Hmm, this last suggestion actually crashes my XChat. Thanks for trying, though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rrr</title>
		<link>http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/#comment-19</link>
		<dc:creator>rrr</dc:creator>
		<pubDate>Tue, 06 Jul 2004 23:14:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/#comment-19</guid>
		<description>Try again:

Replace the square brackets below with less than/greater than:

BUGZILLA_URL = "bug \g[1](http://bugzilla.mozilla.org/show_bug.cgi?id=\g[1])"
</description>
		<content:encoded><![CDATA[<p>Try again:</p>
<p>Replace the square brackets below with less than/greater than:</p>
<p>BUGZILLA_URL = &#8220;bug \g[1](http://bugzilla.mozilla.org/show_bug.cgi?id=\g[1])&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rrr</title>
		<link>http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/#comment-18</link>
		<dc:creator>rrr</dc:creator>
		<pubDate>Tue, 06 Jul 2004 22:52:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/#comment-18</guid>
		<description>Your lambda seems to work for me (if I understand what you want correctly).  Try using the string below as an alternative (for an explanation see the re module reference)

BUGZILLA_URL = "bug \g(http://bugzilla.mozilla.org/show_bug.cgi?id=\g)"
</description>
		<content:encoded><![CDATA[<p>Your lambda seems to work for me (if I understand what you want correctly).  Try using the string below as an alternative (for an explanation see the re module reference)</p>
<p>BUGZILLA_URL = &#8220;bug \g(http://bugzilla.mozilla.org/show_bug.cgi?id=\g)&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: [ct]</title>
		<link>http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/#comment-17</link>
		<dc:creator>[ct]</dc:creator>
		<pubDate>Tue, 06 Jul 2004 13:17:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ebrahim.org/2004/07/06/please-help-me-edit-this-xchat-python-script/#comment-17</guid>
		<description>Unfortunately, I can't help you out with the Python thingy, but after you pointed me to the Perl version, I wrote my own version which just catches anything that matches Bug (numbers) and gives you the URL. It's all _I_ was really looking for. Perhaps you'll find it useful: &lt;a href="http://users.telenet.be/ct/bugzilla-xchat.pl" rel="nofollow"&gt;http://users.telenet.be/ct/bugzilla-xchat.pl&lt;/a&gt;
</description>
		<content:encoded><![CDATA[<p>Unfortunately, I can&#8217;t help you out with the Python thingy, but after you pointed me to the Perl version, I wrote my own version which just catches anything that matches Bug (numbers) and gives you the URL. It&#8217;s all _I_ was really looking for. Perhaps you&#8217;ll find it useful: <a href="http://users.telenet.be/ct/bugzilla-xchat.pl" rel="nofollow">http://users.telenet.be/ct/bugzilla-xchat.pl</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
