<?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>Schurger.org</title>
	<atom:link href="http://schurger.org/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://schurger.org/wordpress</link>
	<description>a simple personal web site where i publish some stuff, usefull for me, maybe usefull to others</description>
	<lastBuildDate>Mon, 26 Jul 2010 15:22:56 +0000</lastBuildDate>
	<language>fr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Little refreshment for vertical gnome panel</title>
		<link>http://schurger.org/wordpress/2010/07/little-refreshment-for-vertical-gnome-panel/</link>
		<comments>http://schurger.org/wordpress/2010/07/little-refreshment-for-vertical-gnome-panel/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 15:12:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Non classé]]></category>

		<guid isPermaLink="false">http://schurger.org/wordpress/?p=108</guid>
		<description><![CDATA[I like to use a vertical panel, because i more need to save place vertically than horizontally. Therefore, the notification area in the gnome panel have an inadequate behavior, it stacks very big icons vertically, following the gnome-panel width. In fact, it does the same thing for the applications launchers, but this can be fixed using the quick lounge [...]]]></description>
			<content:encoded><![CDATA[<p>I like to use a vertical panel, because i more need to save place vertically than horizontally. Therefore, the notification area in the gnome panel have an inadequate behavior, it stacks very big icons vertically, following the gnome-panel width. In fact, it does the same thing for the applications launchers, but this can be fixed using the quick lounge applet. ﻿<a title="Alexander Kojevnikov's blog" href="http://versia.com/2009/09/06/vertical-panel-in-gnome-15-months-later/">Alexander Kojevnikov&#8217;s blog</a> have some patches, about using a gnome panel vertically, some are already integrated, but the one for the notification area needs some refreshment to be applied to the *current* gnome-panel (2.30.2).</p>
<p>Here is an update version of the patch: ﻿﻿﻿<a href="http://schurger.org/na-2.30.2.diff">na-2.30.2.diff</a></p>
<p><a href="http://schurger.org/wordpress/wp-content/vertical-panel1.png"><img class="alignnone size-full wp-image-111" title="vertical-panel" src="http://schurger.org/wordpress/wp-content/vertical-panel1.png" alt="" width="418" height="271" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://schurger.org/wordpress/2010/07/little-refreshment-for-vertical-gnome-panel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android 1.6 on GW620 (LG Eve)</title>
		<link>http://schurger.org/wordpress/2010/06/android-1-6-on-gw620-lg-eve/</link>
		<comments>http://schurger.org/wordpress/2010/06/android-1-6-on-gw620-lg-eve/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 17:45:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Non classé]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[apn]]></category>
		<category><![CDATA[gw620]]></category>
		<category><![CDATA[roger]]></category>
		<category><![CDATA[zacpod]]></category>

		<guid isPermaLink="false">http://schurger.org/wordpress/?p=104</guid>
		<description><![CDATA[(with a title like this, i will have a lot of hits :p) Well, i&#8217;ve just installed an custom Android 1.6 image on my LG GW620, thanks for Zacpod for his workl !! But, this version dosn&#8217;t have the APN configuration tool to enter the parameter to let connect in 3G. As this version seems [...]]]></description>
			<content:encoded><![CDATA[<p>(with a title like this, i will have a lot of hits :p)</p>
<p>Well, i&#8217;ve just installed an custom Android 1.6 image on my LG GW620, thanks for <a title="Zacpod" href="http://www.zacpod.com/">Zacpod</a> for his workl !!</p>
<p>But, this version dosn&#8217;t have the APN configuration tool to enter the parameter to let connect in 3G.</p>
<p>As this version seems to be based on a Korean image for the same phone, the only 3G provider filled in it is not very usefull,</p>
<p>and without the APN configuration tool, it&#8217;s not easy to edit the provider list.</p>
<p>Here is a method to make 3G works on the Roger network.</p>
<ul>
<li>Install the Zacpod image</li>
<li>Freak about no APN configuration</li>
<li><span style="color: #ff0000;"><strong>Download the hacked Zacpod ADB</strong></span> (read it&#8217;s blog, it will be very usefull)</li>
<li>Run <strong>adb shell</strong></li>
<li>Become superuser with <strong>su </strong>(and allow it on the phone screen)</li>
</ul>
<ul>
<li>Take a big breath</li>
<li>run <strong>sqlite3 /data/data/com.android.providers.telephony/databases/telephony.db</strong></li>
<li><strong>INSERT INTO carriers (name, numeric, mcc, mnc, apn, user, server, password, proxy, port, mmsproxy, mmsport, mmsc, type) VALUES (&#8216;Roger&#8217;, &#8217;302720&#8242;, &#8217;302&#8242;, &#8217;720&#8242;, &#8216;internet.com&#8217;, &#8216;wapuser1&#8242;, &#8216;*&#8217;, &#8216;wap&#8217;, &nbsp;&raquo;, &nbsp;&raquo;, &nbsp;&raquo;, &nbsp;&raquo;, &#8216;null&#8217;, &#8216;default&#8217;);</strong></li>
</ul>
<p>Reboot your phone, and it&#8217;s done <img src='http://schurger.org/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://schurger.org/wordpress/2010/06/android-1-6-on-gw620-lg-eve/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google and Pacmac&#8217;s 30th birthday</title>
		<link>http://schurger.org/wordpress/2010/05/google-and-pacmacs-30th-birthday/</link>
		<comments>http://schurger.org/wordpress/2010/05/google-and-pacmacs-30th-birthday/#comments</comments>
		<pubDate>Fri, 21 May 2010 15:05:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Non classé]]></category>

		<guid isPermaLink="false">http://schurger.org/wordpress/?p=100</guid>
		<description><![CDATA[Tomorow will be Pacman&#8217;s 30th birthday ! It seems that Google is preparing something&#8230; and it just leaked onto my browser: (and yes, it&#8217;s playable and doesn&#8217;t require flash)]]></description>
			<content:encoded><![CDATA[<p>Tomorow will be Pacman&#8217;s 30th birthday !</p>
<p>It seems that Google is preparing something&#8230; and it just leaked onto my browser:</p>
<p><em>(and yes, it&#8217;s playable and doesn&#8217;t require flash)</em></p>
<p><a href="http://schurger.org/wordpress/wp-content/google_pacman.png"><img class="aligncenter size-medium wp-image-101" title="google_pacman" src="http://schurger.org/wordpress/wp-content/google_pacman-300x244.png" alt="Google Pacman" width="300" height="244" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://schurger.org/wordpress/2010/05/google-and-pacmacs-30th-birthday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bye bye Facebook.</title>
		<link>http://schurger.org/wordpress/2010/05/bye-bye-facebook/</link>
		<comments>http://schurger.org/wordpress/2010/05/bye-bye-facebook/#comments</comments>
		<pubDate>Wed, 05 May 2010 22:42:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Non classé]]></category>
		<category><![CDATA[!facebook]]></category>

		<guid isPermaLink="false">http://schurger.org/wordpress/?p=96</guid>
		<description><![CDATA[J&#8217;ai finalement conclus que je n&#8217;ai plus aucune raison de garder un compte sur facebook, j&#8217;avais pourtant réussi à prendre l&#8217;habitude de faire abstraction du 95% de contenu composé de niaiseries sans intérêt, et fini par croire que les 5% restants pouvaient être utiles, mais finalement non: - Je préfère garder un carnet d&#8217;adresses privé [...]]]></description>
			<content:encoded><![CDATA[<p>J&#8217;ai finalement conclus que je n&#8217;ai plus aucune raison de garder un compte sur facebook, j&#8217;avais pourtant réussi à prendre l&#8217;habitude de faire abstraction du 95% de contenu composé de niaiseries sans intérêt, et fini par croire que les 5% restants pouvaient être utiles, mais finalement non:</p>
<p>- Je préfère garder un carnet d&#8217;adresses privé<br />
- Les gens qui prétendent participer à des évènement n&#8217;y vont pas<br />
- Je côtoie à peine 20% de mes &laquo;&nbsp;amis facebook&nbsp;&raquo; dans la vrai vie, et n&#8217;ai cure des autres (et c&#8217;est probablement réciproque)<br />
- Facebook use et abuse à son gré de toutes sortes d&#8217;informations personnelles et traces qu&#8217;on peut y laisser.<br />
- Facebook est un logiciel propriétaire.</p>
<p>J&#8217;invite tous les gens qui trouvent agréable où utile de raconter leur vie et de suivre celle des autres sur internet à joindre le réseau social <a title="identi.ca" href="http://identi.ca">identi.ca</a> (et éventuellement quitter facebook).</p>
<p>Je suis toujours joignable par mail ou XMPP: <a href="mailto:jean@schurger.org">jean@schurger.org</a><br />
où par téléphone: (1) 514 994 1045.</p>
<p>English version: ask me.</p>
]]></content:encoded>
			<wfw:commentRss>http://schurger.org/wordpress/2010/05/bye-bye-facebook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Les VOD de la salle Pleyel en RSS</title>
		<link>http://schurger.org/wordpress/2010/04/les-vod-de-la-salle-pleyel-en-rss/</link>
		<comments>http://schurger.org/wordpress/2010/04/les-vod-de-la-salle-pleyel-en-rss/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 19:52:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Concerts]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[pleyel]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://schurger.org/wordpress/?p=93</guid>
		<description><![CDATA[La salle Pleyel diffuse ses concerts en vidéo à la demande, et un tel contenu mérite vraiment le détour. Cependant, les concerts ne sont disponibles que pendant une certaine période, et le seul moyen de se tenir informé des nouveautés à voir et écouter est d'aller régulièrement consulter la liste des concerts. C'est plutôt rébarbatif, [...]]]></description>
			<content:encoded><![CDATA[<p>La salle Pleyel diffuse ses concerts en vidéo à la demande, et un tel contenu mérite vraiment le détour. Cependant, les concerts ne sont disponibles que pendant une certaine période, et le seul moyen de se tenir informé des nouveautés à voir et écouter est d'aller régulièrement consulter la liste des concerts. C'est plutôt rébarbatif, un flux RSS aurait été très pratique.</p>
<p>Le petit bout de script suivant permet de parser la page des concerts, et produit des données au format RSS sur sa sortie standard.</p>
<p>Il suffit simplement de l'invoquer à partir d'un agrégateur pour pouvoir savoir quand un nouveau concert apparaît.</p>
<div class="syntax_hilite">
<div id="python-2">
<div class="python"><span style="color: #ff7a24;">#!/usr/bin/python</span><br />
<span style="color: #ff7a24;"># -*- coding: utf-8 -*-</span></p>
<p><span style="color: #00ffff;">import</span> <span style="color: #00ffff;">urllib2</span><br />
<span style="color: #00ffff;">from</span> lxml <span style="color: #00ffff;">import</span> etree<br />
<span style="color: #00ffff;">from</span> <span style="color: #00ffff;">datetime</span> <span style="color: #00ffff;">import</span> <span style="color: #00ffff;">datetime</span><br />
<span style="color: #00ffff;">from</span> PyRSS2Gen <span style="color: #00ffff;">import</span> RSSItem, RSS2<br />
<span style="color: #00ffff;">from</span> <span style="color: #00ffff;">md5</span> <span style="color: #00ffff;">import</span> <span style="color: #00ffff;">md5</span></p>
<p>URL=<span style="color: #ffa07a;">"http://www.sallepleyel.fr/francais/concerts/videos.aspx"</span><br />
opener = <span style="color: #00ffff;">urllib2</span>.<span style="color: #8e8e8e;">build_opener</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span><br />
req =&nbsp; <span style="color: #00ffff;">urllib2</span>.<span style="color: #8e8e8e;">Request</span><span style="color: #8e8e8e;">&#40;</span>URL<span style="color: #8e8e8e;">&#41;</span><br />
html = etree.<span style="color: #8e8e8e;">HTML</span><span style="color: #8e8e8e;">&#40;</span>opener.<span style="color: #00ffff;">open</span><span style="color: #8e8e8e;">&#40;</span>req<span style="color: #8e8e8e;">&#41;</span>.<span style="color: #8e8e8e;">read</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span><span style="color: #8e8e8e;">&#41;</span><br />
vodlist = <span style="color: #00ffff;">filter</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">lambda</span> ul: ul.<span style="color: #8e8e8e;">attrib</span>.<span style="color: #8e8e8e;">get</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #ffa07a;">'class'</span><span style="color: #8e8e8e;">&#41;</span> == <span style="color: #ffa07a;">"vod"</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;html.<span style="color: #8e8e8e;">findall</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #ffa07a;">".//ul"</span><span style="color: #8e8e8e;">&#41;</span><span style="color: #8e8e8e;">&#41;</span><span style="color: #8e8e8e;">&#91;</span><span style="color: #8e8e8e;">0</span><span style="color: #8e8e8e;">&#93;</span><br />
items = <span style="color: #00ffff;">list</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span><br />
<span style="color: #00ffff;">for</span> e <span style="color: #00ffff;">in</span> vodlist.<span style="color: #8e8e8e;">findall</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #ffa07a;">".//li"</span><span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; a = e.<span style="color: #8e8e8e;">findall</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #ffa07a;">".//a"</span><span style="color: #8e8e8e;">&#41;</span><span style="color: #8e8e8e;">&#91;</span><span style="color: #8e8e8e;">1</span><span style="color: #8e8e8e;">&#93;</span><br />
&nbsp; &nbsp; title = a.<span style="color: #8e8e8e;">find</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #ffa07a;">".//strong"</span><span style="color: #8e8e8e;">&#41;</span>.<span style="color: #8e8e8e;">text</span><br />
&nbsp; &nbsp; link = a.<span style="color: #8e8e8e;">attrib</span>.<span style="color: #8e8e8e;">get</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #ffa07a;">'onclick'</span><span style="color: #8e8e8e;">&#41;</span>.<span style="color: #8e8e8e;">split</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #ffa07a;">"'"</span><span style="color: #8e8e8e;">&#41;</span><span style="color: #8e8e8e;">&#91;</span><span style="color: #8e8e8e;">1</span><span style="color: #8e8e8e;">&#93;</span><br />
&nbsp; &nbsp; items.<span style="color: #8e8e8e;">append</span><span style="color: #8e8e8e;">&#40;</span>RSSItem<span style="color: #8e8e8e;">&#40;</span>title = title,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;link = link,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;description=title,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;guid=<span style="color: #00ffff;">md5</span><span style="color: #8e8e8e;">&#40;</span>link<span style="color: #8e8e8e;">&#41;</span>.<span style="color: #8e8e8e;">hexdigest</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pubDate=<span style="color: #00ffff;">datetime</span>.<span style="color: #8e8e8e;">now</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span><span style="color: #8e8e8e;">&#41;</span><span style="color: #8e8e8e;">&#41;</span><br />
rss = RSS2<span style="color: #8e8e8e;">&#40;</span>title = <span style="color: #ffa07a;">"Salle Pleyel en VOD"</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;link = <span style="color: #ffa07a;">"http://www.sallepleyel.fr/francais/concerts/videos.aspx"</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;description = <span style="color: #ffa07a;">"Concerts en vidéo à la demande (VOD)"</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lastBuildDate = <span style="color: #00ffff;">datetime</span>.<span style="color: #8e8e8e;">now</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;items = items<span style="color: #8e8e8e;">&#41;</span><br />
<span style="color: #00ffff;">print</span> rss.<span style="color: #8e8e8e;">to_xml</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span></div>
</div>
</div>
<p></p>
<p>Bonne écoute.</p>
]]></content:encoded>
			<wfw:commentRss>http://schurger.org/wordpress/2010/04/les-vod-de-la-salle-pleyel-en-rss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bye bye MSN !</title>
		<link>http://schurger.org/wordpress/2010/03/bye-bye-msn/</link>
		<comments>http://schurger.org/wordpress/2010/03/bye-bye-msn/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 17:03:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[MSN]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[papyon]]></category>

		<guid isPermaLink="false">http://schurger.org/wordpress/?p=86</guid>
		<description><![CDATA[Ça y est, je me débarasse de MSN. Mais comme je suis conscient que certaines personnes ne connaissent que ça, voici un petit compromis, qui plus est: éducatif. Il sagit d'un répondeur automatique à MSN écrit en python, utilisant papyon. (This is an auto responder for MSN, written in the python language, and using the papyon library) [...]]]></description>
			<content:encoded><![CDATA[<p>Ça y est, je me débarasse de MSN. Mais comme je suis conscient que certaines personnes ne connaissent que ça, voici un petit compromis, qui plus est: éducatif.<br />
Il sagit d'un répondeur automatique à MSN écrit en <a href="http://www.python.org">python</a>, utilisant <a href="http://telepathy.freedesktop.org/wiki/Papyon">papyon</a>.</p>
<p>(This is an auto responder for MSN, written in the <a href="http://www.python.org">python</a> language, and using the <a href="http://telepathy.freedesktop.org/wiki/Papyon">papyon</a> library)</p>
<div class="syntax_hilite">
<div id="python-4">
<div class="python"><span style="color: #ff7a24;">#!/usr/bin/env python</span><br />
<span style="color: #ff7a24;"># -*- coding: utf-8 -*-</span></p>
<p><span style="color: #00ffff;">import</span> <span style="color: #00ffff;">signal</span><br />
<span style="color: #00ffff;">import</span> papyon<br />
<span style="color: #00ffff;">import</span> papyon.<span style="color: #8e8e8e;">event</span><br />
<span style="color: #00ffff;">import</span> gobject<br />
<span style="color: #00ffff;">import</span> <span style="color: #00ffff;">logging</span></p>
<p><span style="color: #00ffff;">logging</span>.<span style="color: #8e8e8e;">basicConfig</span><span style="color: #8e8e8e;">&#40;</span>level=<span style="color: #00ffff;">logging</span>.<span style="color: #8e8e8e;">ERROR</span><span style="color: #8e8e8e;">&#41;</span></p>
<p><span style="color: #00ffff;">USER</span> = <span style="color: #ffa07a;">"user@hotmail.com"</span><br />
PASSWORD = <span style="color: #ffa07a;">"p4ssW0rD"</span><br />
LAYUS = u<span style="color: #ffa07a;">""</span><span style="color: #ffa07a;">"</p>
<p>English bellow.</p>
<p>Bonjour,</p>
<p>&nbsp; Ceci est une réponse automatique vous expliquant que je ne veux<br />
&nbsp; plus discuter par MSN.</p>
<p>&nbsp; En résumé, MSN est fermé, et fonctionne mal.<br />
&nbsp; Il y a beaucoup d'alternatives libres et efficaces.</p>
<p>&nbsp; Pour la version longue, lire:<br />
&nbsp; - http://schurger.org/la-vie-est-possible-sans-msn.html</p>
<p>&nbsp; Je serai ravi de discuter:<br />
&nbsp; - En le protocol XMPP (Jabber, Google talk,...).<br />
&nbsp; &nbsp; (Mon identifiant est jean@schurger.org)<br />
&nbsp; - Sur IRC, via le serveur irc.freenode.net, mon nickname est jeansch<br />
&nbsp; - En utilisant la fonction clavardage de Facebook</p>
<p>&nbsp; Amicalement,</p>
<p>&nbsp; Jean.</p>
<p>---<br />
&nbsp; <br />
Hello,</p>
<p>&nbsp; This is an automatic answer telling why i don't want to chat using MSN.</p>
<p>&nbsp; Basicaly, the reasons are that MSN is closed and works badly.<br />
&nbsp; There is a lot of realy great open alternatives.</p>
<p>&nbsp; For more details, read:<br />
&nbsp; - http://schurger.org/life-is-possible-without-msn.html</p>
<p>&nbsp; I'll be happy to chat using:<br />
&nbsp; - The XMPP protocol (Jabber, Google talk,...)<br />
&nbsp; &nbsp; (My id is jean@schurger.org)<br />
&nbsp; - On IRC, on server irc.freenode.net, my nickname is jeansch<br />
&nbsp; - Using the chat Facebook feature</p>
<p>&nbsp; Friendly,</p>
<p>&nbsp; Jean.<br />
"</span><span style="color: #ffa07a;">""</span></p>
<p><span style="color: #00ffff;">class</span> ClientEvents<span style="color: #8e8e8e;">&#40;</span>papyon.<span style="color: #8e8e8e;">event</span>.<span style="color: #8e8e8e;">BaseEventInterface</span><span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #00ffff;">def</span> on_client_state_changed<span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span>, state<span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">if</span> state == papyon.<span style="color: #8e8e8e;">event</span>.<span style="color: #8e8e8e;">ClientState</span>.<span style="color: #8e8e8e;">CLOSED</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>._client.<span style="color: #8e8e8e;">quit</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">elif</span> state == papyon.<span style="color: #8e8e8e;">event</span>.<span style="color: #8e8e8e;">ClientState</span>.<span style="color: #00ffff;">OPEN</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>._client.<span style="color: #00ffff;">profile</span>.<span style="color: #8e8e8e;">display_name</span> = <span style="color: #ffa07a;">"Jean Schurger"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>._client.<span style="color: #00ffff;">profile</span>.<span style="color: #8e8e8e;">presence</span> = papyon.<span style="color: #8e8e8e;">Presence</span>.<span style="color: #8e8e8e;">ONLINE</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>._client.<span style="color: #00ffff;">profile</span>.<span style="color: #8e8e8e;">personal_message</span> = <span style="color: #ffa07a;">"Boycott de MSN"</span></p>
<p>&nbsp; &nbsp; <span style="color: #00ffff;">def</span> on_invite_conversation<span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span>, conversation<span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; conversation.<span style="color: #8e8e8e;">send_typing_notification</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; conversation.<span style="color: #8e8e8e;">send_text_message</span><span style="color: #8e8e8e;">&#40;</span>papyon.<span style="color: #8e8e8e;">ConversationMessage</span><span style="color: #8e8e8e;">&#40;</span>LAYUS<span style="color: #8e8e8e;">&#41;</span><span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; conversation.<span style="color: #8e8e8e;">leave</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color: #00ffff;">class</span> Client<span style="color: #8e8e8e;">&#40;</span>papyon.<span style="color: #8e8e8e;">Client</span><span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #00ffff;">def</span> <span style="color: #87cefa;">__init__</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span>, account, quit, http_mode=<span style="color: #00ffff;">False</span><span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; server = <span style="color: #8e8e8e;">&#40;</span><span style="color: #ffa07a;">'messenger.hotmail.com'</span>, <span style="color: #8e8e8e;">1863</span><span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">quit</span> = quit<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">account</span> = <span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">USER</span>, PASSWORD<span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; papyon.<span style="color: #8e8e8e;">Client</span>.<span style="color: #87cefa;">__init__</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span>, server<span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>._event_handler = ClientEvents<span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span><span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; gobject.<span style="color: #8e8e8e;">idle_add</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span>._connect<span style="color: #8e8e8e;">&#41;</span></p>
<p>&nbsp; &nbsp; <span style="color: #00ffff;">def</span> _connect<span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span><span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">login</span><span style="color: #8e8e8e;">&#40;</span>*<span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">account</span><span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">return</span> <span style="color: #00ffff;">False</span></p>
<p>
<span style="color: #00ffff;">def</span> main<span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; mainloop = gobject.<span style="color: #8e8e8e;">MainLoop</span><span style="color: #8e8e8e;">&#40;</span>is_running=<span style="color: #00ffff;">True</span><span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #00ffff;">def</span> quit<span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; mainloop.<span style="color: #8e8e8e;">quit</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #00ffff;">def</span> sigterm_cb<span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; gobject.<span style="color: #8e8e8e;">idle_add</span><span style="color: #8e8e8e;">&#40;</span>quit<span style="color: #8e8e8e;">&#41;</span></p>
<p>&nbsp; &nbsp; <span style="color: #00ffff;">signal</span>.<span style="color: #00ffff;">signal</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">signal</span>.<span style="color: #8e8e8e;">SIGTERM</span>, sigterm_cb<span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; c = Client<span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">USER</span>, PASSWORD<span style="color: #8e8e8e;">&#41;</span>, quit<span style="color: #8e8e8e;">&#41;</span></p>
<p>&nbsp; &nbsp; <span style="color: #00ffff;">while</span> mainloop.<span style="color: #8e8e8e;">is_running</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">try</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mainloop.<span style="color: #8e8e8e;">run</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">except</span> <span style="color: #00ffff;">KeyboardInterrupt</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; quit<span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span></p>
<p><span style="color: #00ffff;">if</span> __name__ == <span style="color: #ffa07a;">'__main__'</span>:<br />
&nbsp; &nbsp; main<span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span></div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://schurger.org/wordpress/2010/03/bye-bye-msn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Je vais à Confoo</title>
		<link>http://schurger.org/wordpress/2010/03/im-going-to-confoo/</link>
		<comments>http://schurger.org/wordpress/2010/03/im-going-to-confoo/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 00:01:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Non classé]]></category>

		<guid isPermaLink="false">http://schurger.org/wordpress/?p=82</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.confoo.ca/fr/"><img alt="confoo.ca Web Techno Conference" style="border:0" width="150" height="100" src="http://www.confoo.ca/images/propaganda/2010/fr/going.jpg" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://schurger.org/wordpress/2010/03/im-going-to-confoo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://schurger.org/wordpress/2010/03/79/</link>
		<comments>http://schurger.org/wordpress/2010/03/79/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 23:59:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[keyring]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[pymacs]]></category>

		<guid isPermaLink="false">http://schurger.org/wordpress/?p=79</guid>
		<description><![CDATA[Tired of typing your #freenode password when ERC is connecting ? You don't want to write you passwords as clear text in your .emacs files ? Lets see how to store, passwords in the Gnome Keyring, and access it from Emacs. It only needs Pymacs and gnome-keyring python bindings. Write a little module to read [...]]]></description>
			<content:encoded><![CDATA[<p>Tired of typing your <strong>#freenode</strong> password when <a title="ERC" href="http://www.emacswiki.org/emacs/?action=browse;oldid=EmacsIRCClient;id=ERC">ERC</a> is connecting ? You don't want to write you passwords as clear text in your <strong>.emacs</strong> files ?</p>
<p>Lets see how to store, passwords in the Gnome Keyring, and access it from Emacs. It only needs <a title="Pymacs" href="http://pymacs.progiciels-bpi.ca/">Pymacs</a> and gnome-keyring python bindings.</p>
<ul>
<li>Write a little module to read and write passwords. This module will be loaded my pymacs and its functions will be available from emacs-lisp. You may name your module '<strong>gnome-keyring.py</strong>' and store it somewhere like '<strong>~/.emacs.d/pymacs/</strong>'</li>
</ul>
<div class="syntax_hilite">
<div id="python-9">
<div class="python"><span style="color: #00ffff;">def</span> get_password<span style="color: #8e8e8e;">&#40;</span>name<span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #00ffff;">import</span> gnomekeyring as gk<br />
&nbsp; &nbsp; <span style="color: #00ffff;">try</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; items = gk.<span style="color: #8e8e8e;">find_items_sync</span><span style="color: #8e8e8e;">&#40;</span>gk.<span style="color: #8e8e8e;">ITEM_GENERIC_SECRET</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00ffff;">dict</span><span style="color: #8e8e8e;">&#40;</span>variable_name=name<span style="color: #8e8e8e;">&#41;</span><span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #00ffff;">except</span> gk.<span style="color: #8e8e8e;">NoMatchError</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">return</span> <span style="color: #00ffff;">None</span><br />
&nbsp; &nbsp; <span style="color: #00ffff;">return</span> items<span style="color: #8e8e8e;">&#91;</span><span style="color: #8e8e8e;">0</span><span style="color: #8e8e8e;">&#93;</span>.<span style="color: #8e8e8e;">secret</span><br />
get_password.<span style="color: #8e8e8e;">interaction</span> = <span style="color: #ffa07a;">""</span></p>
<p><span style="color: #00ffff;">def</span> set_password<span style="color: #8e8e8e;">&#40;</span>name, password<span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #00ffff;">import</span> gnomekeyring as gk<br />
&nbsp; &nbsp; gk.<span style="color: #8e8e8e;">item_create_sync</span><span style="color: #8e8e8e;">&#40;</span>gk.<span style="color: #8e8e8e;">get_default_keyring_sync</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gk.<span style="color: #8e8e8e;">ITEM_GENERIC_SECRET</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ffa07a;">"Emacs password"</span>, <span style="color: #00ffff;">dict</span><span style="color: #8e8e8e;">&#40;</span>variable_name=name<span style="color: #8e8e8e;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; password, <span style="color: #00ffff;">True</span><span style="color: #8e8e8e;">&#41;</span>,<br />
set_password.<span style="color: #8e8e8e;">interaction</span> = <span style="color: #ffa07a;">""</span></div>
</div>
</div>
<p></p>
<ul>
<li>Load the module using pymacs</li>
</ul>
<div class="syntax_hilite">
<div id="python-10">
<div class="python"><span style="color: #8e8e8e;">&#40;</span>require <span style="color: #ffa07a;">'pymacs)<br />
(add-to-list '</span>pymacs-load-path <span style="color: #ffa07a;">"~/.emacs.d/pymacs/"</span><span style="color: #8e8e8e;">&#41;</span><br />
<span style="color: #8e8e8e;">&#40;</span>pymacs-load <span style="color: #ffa07a;">"gnome-keyring"</span> <span style="color: #ffa07a;">"gnome-keyring-"</span><span style="color: #8e8e8e;">&#41;</span></div>
</div>
</div>
<p></p>
<ul>
<li>Trying from the interactive emacs lisp mode (<em>M-x ielm</em>)</li>
</ul>
<div class="syntax_hilite">
<div id="python-11">
<div class="python">ELISP&gt; <span style="color: #8e8e8e;">&#40;</span>gnome-keyring-set-password <span style="color: #ffa07a;">"my-password"</span> <span style="color: #ffa07a;">"p4$$w0rD"</span><span style="color: #8e8e8e;">&#41;</span><br />
nil<br />
ELISP&gt; <span style="color: #8e8e8e;">&#40;</span>gnome-keyring-get-password <span style="color: #ffa07a;">"my-password"</span><span style="color: #8e8e8e;">&#41;</span><br />
<span style="color: #ffa07a;">"p4$$w0rD"</span></div>
</div>
</div>
<p></p>
<ul>
<li>And now, an example for ERC</li>
</ul>
<div class="syntax_hilite">
<div id="python-12">
<div class="python"><span style="color: #8e8e8e;">&#40;</span>setq erc-password <span style="color: #8e8e8e;">&#40;</span>gnome-keyring-get-password <span style="color: #ffa07a;">"my-password"</span><span style="color: #8e8e8e;">&#41;</span><span style="color: #8e8e8e;">&#41;</span><br />
<span style="color: #8e8e8e;">&#40;</span>setq erc-prompt-for-password nil<span style="color: #8e8e8e;">&#41;</span></div>
</div>
</div>
<p>
Too easy ! <img src='http://schurger.org/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://schurger.org/wordpress/2010/03/79/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unit tests with Pylons and its XMLRPCController</title>
		<link>http://schurger.org/wordpress/2009/12/unit-tests-with-pylons-and-its-xmlrpccontroller/</link>
		<comments>http://schurger.org/wordpress/2009/12/unit-tests-with-pylons-and-its-xmlrpccontroller/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 23:37:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://schurger.org/wordpress/?p=73</guid>
		<description><![CDATA[Now that you have implemented a nice XMLRPCController in your pylons application, it's time to write unit tests covering it. The problem is that the xmlrpclib will try to make a real http connection to an address, but the TestApp used in your TestController is not a real server, and don't listen to any address. [...]]]></description>
			<content:encoded><![CDATA[<p>Now that you have implemented a nice XMLRPCController in your pylons application, it's time to write unit tests covering it. The problem is that the xmlrpclib will try to make a real http connection to an address, but the TestApp used in your TestController is not a real server, and don't listen to any address.</p>
<p>Here is a quick way to enable the coverage of your XMLRPCController. Inspired by Kumar McMillan on this <a href="http://groups.google.com/group/pylons-discuss/browse_thread/thread/6c8fc792116bf149/72b7d727654fbd69?#72b7d727654fbd69">thread</a>.</p>
<div class="syntax_hilite">
<div id="python-14">
<div class="python"><span style="color: #00ffff;">from</span> <span style="color: #00ffff;">StringIO</span> <span style="color: #00ffff;">import</span> <span style="color: #00ffff;">StringIO</span><br />
<span style="color: #00ffff;">import</span> <span style="color: #00ffff;">xmlrpclib</span><br />
<span style="color: #00ffff;">from</span> <span style="color: #00ffff;">xmlrpclib</span> <span style="color: #00ffff;">import</span> ServerProxy<br />
<span style="color: #00ffff;">from</span> mygreatapp.<span style="color: #8e8e8e;">tests</span> <span style="color: #00ffff;">import</span> TestController</p>
<p><span style="color: #ff7a24;"># a fake httplib.HTTP using 'app' (see TestController.__init__())</span><br />
<span style="color: #00ffff;">class</span> WSGILikeHTTP<span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">def</span> <span style="color: #87cefa;">__init__</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span>, host, app<span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">app</span> = app<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">headers</span> = <span style="color: #8e8e8e;">&#123;</span><span style="color: #8e8e8e;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">content</span> = <span style="color: #00ffff;">StringIO</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">def</span> putrequest<span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span>, method, handler<span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">method</span> = method<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">handler</span> = handler<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">def</span> putheader<span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span>, key, value<span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">headers</span><span style="color: #8e8e8e;">&#91;</span>key<span style="color: #8e8e8e;">&#93;</span> = value<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">def</span> endheaders<span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span><span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">pass</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">def</span> send<span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span>, body<span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">body</span> = body<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">def</span> getfile<span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span><span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">return</span> <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">content</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">def</span> getreply<span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span><span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">if</span> <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">method</span> == <span style="color: #ffa07a;">"POST"</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; r = <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">app</span>.<span style="color: #8e8e8e;">post</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">handler</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; headers=<span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">headers</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; params=<span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">body</span><span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">content</span> = <span style="color: #00ffff;">StringIO</span><span style="color: #8e8e8e;">&#40;</span>r.<span style="color: #8e8e8e;">response</span><span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">return</span> <span style="color: #8e8e8e;">&#40;</span><span style="color: #8e8e8e;">200</span>, <span style="color: #00ffff;">None</span>, <span style="color: #00ffff;">None</span><span style="color: #8e8e8e;">&#41;</span></p>
<p><span style="color: #00ffff;">class</span> WSGIAppTransport<span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">xmlrpclib</span>.<span style="color: #8e8e8e;">Transport</span><span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7a24;"># Only here to pass the 'app'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">def</span> <span style="color: #87cefa;">__init__</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span>, app<span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">xmlrpclib</span>.<span style="color: #8e8e8e;">Transport</span>.<span style="color: #87cefa;">__init__</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span><span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">app</span> = app</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7a24;"># return the fake httplib.HTTP(host)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">def</span> make_connection<span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span>, host<span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; host, extra_headers, x509 = <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">get_host_info</span><span style="color: #8e8e8e;">&#40;</span>host<span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">return</span> WSGILikeHTTP<span style="color: #8e8e8e;">&#40;</span>host, <span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">app</span><span style="color: #8e8e8e;">&#41;</span></p>
<p><span style="color: #00ffff;">class</span> TestApiController<span style="color: #8e8e8e;">&#40;</span>TestController<span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00ffff;">def</span> test_super_function<span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span><span style="color: #8e8e8e;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7a24;"># URL _MUST_ starts with 'http' or 'https' (see xmlrpclib.py)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; server = ServerProxy<span style="color: #8e8e8e;">&#40;</span><span style="color: #ffa07a;">'http://dummy/api'</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;transport=WSGIAppTransport<span style="color: #8e8e8e;">&#40;</span><span style="color: #00ffff;">self</span>.<span style="color: #8e8e8e;">app</span><span style="color: #8e8e8e;">&#41;</span><span style="color: #8e8e8e;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; server.<span style="color: #8e8e8e;">super_function</span><span style="color: #8e8e8e;">&#40;</span><span style="color: #ffa07a;">"Foo"</span>, <span style="color: #ffa07a;">"Bla"</span>, <span style="color: #8e8e8e;">42</span><span style="color: #8e8e8e;">&#41;</span></div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://schurger.org/wordpress/2009/12/unit-tests-with-pylons-and-its-xmlrpccontroller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apologies and gpr400</title>
		<link>http://schurger.org/wordpress/2009/12/apologies-and-gpr400/</link>
		<comments>http://schurger.org/wordpress/2009/12/apologies-and-gpr400/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 21:59:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Non classé]]></category>

		<guid isPermaLink="false">http://schurger.org/wordpress/?p=70</guid>
		<description><![CDATA[It seems that i have forgotten to mention the authors of the different gpr400 driver implementations or patches when i began to work on it. Thanks to: - Pierrick Hascoet - Henry Plötz - Jaiger]]></description>
			<content:encoded><![CDATA[<p>It seems that i have forgotten to mention the authors of the different gpr400 driver implementations or patches when i began to work on it.</p>
<p>Thanks to:</p>
<p>- Pierrick Hascoet</p>
<p>- Henry Plötz</p>
<p>- Jaiger</p>
]]></content:encoded>
			<wfw:commentRss>http://schurger.org/wordpress/2009/12/apologies-and-gpr400/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
