<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Allan Saddi's projects blog - Python</title>
    <link>http://www.saddi.com/software/news/</link>
    <description>Announcements and ramblings about projects new and old.</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.0.4 - http://www.s9y.org/</generator>
    <pubDate>Thu, 24 Jul 2008 09:28:24 GMT</pubDate>

    <image>
        <url>http://www.saddi.com/software/news/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Allan Saddi's projects blog - Python - Announcements and ramblings about projects new and old.</title>
        <link>http://www.saddi.com/software/news/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>flup 1.0.1 released</title>
    <link>http://www.saddi.com/software/news/archives/63-flup-1.0.1-released.html</link>
            <category>flup</category>
    
    <comments>http://www.saddi.com/software/news/archives/63-flup-1.0.1-released.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=63</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=63</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    A very minor update to flup. If you aren&#039;t having any problems now, then there&#039;s probably no need to upgrade.&lt;br /&gt;
&lt;br /&gt;
This update concerns certain web servers &amp;amp; configurations that don&#039;t correctly supply PATH_INFO and/or QUERY_STRING to flup. When missing these environment entries, the flup servers will now attempt to deduce PATH_INFO and/or QUERY_STRING from REQUEST_URI (if it is present) before defaulting to the empty string (as it did before).&lt;br /&gt;
&lt;br /&gt;
Thanks to Richard Davies for the patch. 
    </content:encoded>

    <pubDate>Tue, 22 Jul 2008 11:50:55 -0700</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/63-guid.html</guid>
    
</item>
<item>
    <title>Middleware, publisher alternatives</title>
    <link>http://www.saddi.com/software/news/archives/61-Middleware,-publisher-alternatives.html</link>
            <category>flup</category>
    
    <comments>http://www.saddi.com/software/news/archives/61-Middleware,-publisher-alternatives.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=61</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=61</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    With the advent of flup 1.0 and the disappearance of the middleware modules (I don&#039;t think anyone really cares about Publisher &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;), I&#039;ve been getting a few queries here and there about alternatives.&lt;br /&gt;
&lt;br /&gt;
Rather than continue to answer people individually, here are some alternatives to flup&#039;s middleware and publisher modules. However, they represent alternatives that I&#039;ve personally chosen. (And considering how far removed I am nowadays from the world of Python web development, take my choices with a grain of salt.) Suggestions for other alternatives (alternative alternatives?!?) are welcome.&lt;br /&gt;
&lt;br /&gt;
For users of flup&#039;s SessionMiddleware, I recommend &lt;a href=&quot;http://beaker.groovie.org/&quot;&gt;Beaker&lt;/a&gt;. Switching over is a simple matter of changing the environ key from &#039;com.saddi.service.session&#039; to &#039;beaker.session&#039; and ensuring that session.save() is called before the WSGI application returns. (After you&#039;ve appropriately swapped out flup&#039;s SessionMiddleware with Beaker&#039;s in the WSGI stack, of course.)&lt;br /&gt;
&lt;br /&gt;
GzipMiddleware and ErrorMiddleware have analogues in &lt;a href=&quot;http://pythonpaste.org/&quot;&gt;Python Paste&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
flup&#039;s Publisher is probably most like &lt;a href=&quot;http://wsgiarea.pocoo.org/colubrid/&quot;&gt;Colubrid&lt;/a&gt;, though I haven&#039;t personally tried it. (Also remember that flup&#039;s Publisher was inspired by mod_python&#039;s &lt;a href=&quot;http://www.modpython.org/live/current/doc-html/hand-pub.html&quot;&gt;Publisher&lt;/a&gt;, which was apparently inspired by Zope&#039;s ZPublisher &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;).&lt;br /&gt;
&lt;br /&gt;
Anyway, I updated the old &lt;a href=&quot;http://hg.saddi.com/flup&quot;&gt;flup 0.5 branch&lt;/a&gt; and uploaded the source distribution to the &lt;a href=&quot;http://pypi.python.org/pypi/flup/0.5&quot;&gt;Cheese Shop&lt;/a&gt;. I really don&#039;t want to maintain two branches, so consider this 0.5 release final. 
    </content:encoded>

    <pubDate>Tue, 25 Sep 2007 17:06:12 -0700</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/61-guid.html</guid>
    
</item>
<item>
    <title>flup 1.0 released</title>
    <link>http://www.saddi.com/software/news/archives/58-flup-1.0-released.html</link>
            <category>flup</category>
    
    <comments>http://www.saddi.com/software/news/archives/58-flup-1.0-released.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=58</wfw:comment>

    <slash:comments>7</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=58</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    I resolved a few more outstanding issues with flup and decided to make a release. I went ahead and called it 1.0. And as I &lt;a href=&quot;http://www.saddi.com/software/news/archives/45-QUERY_STRING-changes-to-servers,-API-changes-to-GzipMiddleware,-future-changes.html&quot;&gt;previously mentioned&lt;/a&gt;, I went ahead and removed the publisher and middleware modules.&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve been following the Subversion repository for flup (which has been quiet due to my switching to Mercurial), there have only been 1 or 2 new fixes.&lt;br /&gt;
&lt;br /&gt;
I also uploaded the tarball and 2.5 egg to the &lt;a href=&quot;http://pypi.python.org/pypi/flup/1.0&quot;&gt;Cheese Shop&lt;/a&gt;. Further updates will also go to the Cheese Shop.&lt;br /&gt;
&lt;br /&gt;
And on the subject of further updates, consider flup to be in maintenance mode - there won&#039;t be any more new development. Bug fixes and bug reports are still welcome, of course. (Though this has been the way I&#039;ve run flup for quite a while now, so I&#039;m just making a formal announcement. &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;)&lt;br /&gt;
&lt;br /&gt;
And as a bit of editorializing, did I ever mention how much I &lt;strong&gt;hate&lt;/strong&gt; FastCGI? &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; Around the time I first released flup, I had transitioned my apps from FastCGI to AJP, and I never missed FastCGI since. But much to my disappointment, the FastCGI module was the most popular... most likely due to ubiquitous &amp;amp; cheap shared hosting services (e.g. Dreamhost).&lt;br /&gt;
&lt;br /&gt;
Oh well, I don&#039;t even use flup myself anymore. I&#039;ve switched to ajp-wsgi... 
    </content:encoded>

    <pubDate>Mon, 10 Sep 2007 16:59:33 -0700</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/58-guid.html</guid>
    
</item>
<item>
    <title>ajp-wsgi 1.0 released</title>
    <link>http://www.saddi.com/software/news/archives/55-ajp-wsgi-1.0-released.html</link>
            <category>Python</category>
    
    <comments>http://www.saddi.com/software/news/archives/55-ajp-wsgi-1.0-released.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=55</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=55</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    &lt;a href=&quot;/software/ajp-wsgi/&quot;&gt;ajp-wsgi&lt;/a&gt; 1.0 has been released. It may be downloaded &lt;a href=&quot;/software/ajp-wsgi/dist/&quot;&gt;here&lt;/a&gt; (&lt;a href=&quot;/software/ajp-wsgi/dist/ChangeLog&quot;&gt;ChangeLog&lt;/a&gt;). It&#039;s been sitting around for a few months now, in heavy use at my server for both &quot;production&quot; and development WSGI apps. I think it&#039;s pretty safe to say it&#039;s at least on par with flup&#039;s ajp WSGIServer now. &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
The only lingering issue is a core dump with Trac and only Trac, and only when it is killed or SIGHUP&#039;d. Unfortunately, with so many variables (Trac imports quite a few C extension modules), I haven&#039;t been able to isolate problem. (And maybe it&#039;s just my environment... sadly, I don&#039;t have the resources to try elsewhere.)&lt;br /&gt;
&lt;br /&gt;
Anyway, 1.0... so what now? &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; 
    </content:encoded>

    <pubDate>Fri, 06 Apr 2007 11:07:24 -0700</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/55-guid.html</guid>
    
</item>
<item>
    <title>ajp-wsgi future directions</title>
    <link>http://www.saddi.com/software/news/archives/54-ajp-wsgi-future-directions.html</link>
            <category>Python</category>
    
    <comments>http://www.saddi.com/software/news/archives/54-ajp-wsgi-future-directions.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=54</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=54</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    My C WSGI implementation is relatively decoupled from the transport code (AJP). It&#039;s conceivable that replacing the transport layer with something else is entirely possible. Like say... a full HTTP 1.1 server. I guess there could be two directions to take that:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;http-wsgi&lt;/strong&gt;&lt;br /&gt;
I suppose one could take an embeddable HTTP server (or write one from scratch, if so inclined) and glue the WSGI code into the request handling pipeline. Personally, it&#039;s not a project that interests me much. Leave web server writing to the web server experts, I say. However, suppose one wrote it as an extension module for one of the popular web servers...&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;mod_wsgi&lt;/strong&gt;&lt;br /&gt;
How about an extension module for say, Apache HTTPD or lighttpd? The problem I see with this is that, functionally, it would just be equivalent to mod_python. (After all, you&#039;re just embedding Python into the web server and patching into its request processing.) I think the only difference would be that the WSGI-adapter code (the layer that sits just above Python) would be written in C. Additionally, you inherit some of the more interesting problems of mod_python... namely conforming Python&#039;s process/threading model to that of the web server&#039;s. In all likelihood, you would be running multi-process, not multi-threaded. I guess if you were clever, you could run the Python interpreter in only a single process, similar to how CGI works in modern versions of Apache HTTPD.&lt;br /&gt;
&lt;br /&gt;
But then, if you do that, all it buys you is automatic process management versus using an external server model like AJP/SCGI. So why bother with yet another mod_somethingsomething?&lt;br /&gt;
&lt;br /&gt;
Anyway, ajp-wsgi will remain ajp-wsgi for the foreseeable future. (If I&#039;m sufficiently bored and curious, I may try creating an scgi-wsgi someday.) Though http-wsgi does pique my interest somewhat... I just have to find a suitably feature-laden embeddable C web server. 
    </content:encoded>

    <pubDate>Thu, 15 Feb 2007 16:25:17 -0800</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/54-guid.html</guid>
    
</item>
<item>
    <title>Updates</title>
    <link>http://www.saddi.com/software/news/archives/52-Updates.html</link>
            <category>Python</category>
    
    <comments>http://www.saddi.com/software/news/archives/52-Updates.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=52</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=52</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    Well, not much has been happening. &lt;a href=&quot;http://www.saddi.com/software/ajp-wsgi/&quot;&gt;ajp-wsgi&lt;/a&gt; has been humming along, stable as a rock. It&#039;s been running all of my Python-based websites for a little over a month now (longer, really, since I had to reboot my server early January to update FreeBSD). Once I make a few documentation updates, I think it would be safe to declare a 1.0 release. (Seemingly a big milestone nowadays...) 
    </content:encoded>

    <pubDate>Wed, 14 Feb 2007 14:44:38 -0800</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/52-guid.html</guid>
    
</item>
<item>
    <title>ajp-wsgi released</title>
    <link>http://www.saddi.com/software/news/archives/51-ajp-wsgi-released.html</link>
            <category>Python</category>
    
    <comments>http://www.saddi.com/software/news/archives/51-ajp-wsgi-released.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=51</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=51</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    Well, after a week of coding, I decided to &quot;release&quot; &lt;code&gt;ajp-wsgi&lt;/code&gt; (i.e. make its existence known beyond my web sites and blog). It&#039;s a rather niche project, but if one other person finds it useful, then hey, cool. &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; Releasing it costs me nothing.&lt;br /&gt;
&lt;br /&gt;
I found it highly educational to create, illuminating the mysteries of the Python C API. Plus I&#039;m using it everywhere now. And after having closed &lt;a href=&quot;http://trac.saddi.com/projects/ticket/4&quot;&gt;ticket #4&lt;/a&gt;, the solution of which seems to have been a panacea to all current issues, it&#039;s pretty much complete as far as I envisioned it.&lt;br /&gt;
&lt;br /&gt;
Now maybe I can get back to &lt;a href=&quot;http://www.saddi.com/software/flannel/&quot;&gt;Flannel&lt;/a&gt;...&lt;br /&gt;
&lt;br /&gt;
And I have thought about writing an SCGI version as well... but it&#039;s not something I would use. So what&#039;s the point? I don&#039;t really like supporting something I don&#039;t use regularly, though by virtue of being free software, I&#039;m not really obligated to provide any support. (But I still do because I&#039;m a nice guy. &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;) Maybe if Apache HTTPD eventually adds a mod_proxy_scgi though...&lt;br /&gt;
&lt;br /&gt;
Ah, &lt;a href=&quot;http://www.google.com/search?q=mod_proxy_scgi&quot;&gt;no Google hits&lt;/a&gt; for mod_proxy_scgi. Oh well. At least this entry may eventually show up. 
    </content:encoded>

    <pubDate>Sat, 16 Dec 2006 19:49:18 -0800</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/51-guid.html</guid>
    
</item>
<item>
    <title>Ah-ha!</title>
    <link>http://www.saddi.com/software/news/archives/50-Ah-ha!.html</link>
            <category>Python</category>
    
    <comments>http://www.saddi.com/software/news/archives/50-Ah-ha!.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=50</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=50</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    Apparently, I did not read the AJP13 spec nor my original code very closely:&lt;br /&gt;
&lt;blockquote&gt;Note: The content-length header is extremely important. If it is present and non-zero, the container assumes that the request has a body (a POST request, for example), and immediately reads a separate packet off the input stream to get that body.&lt;/blockquote&gt;Here I was &lt;em&gt;requesting&lt;/em&gt; the first block. Anyway, a quick and easy fix.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;ajp-wsgi&lt;/code&gt; is moving along... and actually, development has slowed down immensely (a marked sign of stability?). I&#039;ve converted all Python WSGI applications on my server to use it now. It may just be psychological, but I &lt;em&gt;do&lt;/em&gt; notice application responses being a bit snappier. But who knows.&lt;br /&gt;
&lt;br /&gt;
Trac seemed to be the most non-trivial to convert. It doesn&#039;t provide a ready-made application factory to create the WSGI app object. I basically had to mimic (using my config options) the operations that its main() method performed. Other applications (my own blog &amp;amp; shorten projects, moinmoin) had readily-available app objects though. And I&#039;m also glad to say that Paste Deploy-based apps are easily deployed with &lt;code&gt;ajp-wsgi&lt;/code&gt; as well.&lt;br /&gt;
&lt;br /&gt;
Anyhow, I went ahead and decoupled the C WSGI code from the AJP code today. Now the next time I&#039;m bored, I think I&#039;ll write drivers for both ends of an SCGI connection. It would be interesting if I could write that FastCGI-&gt;SCGI adapter wholly in C (using the standard C FastCGI dev kit). Actually, I guess I should check if there&#039;s already a C SCGI implementation... 
    </content:encoded>

    <pubDate>Thu, 14 Dec 2006 16:30:24 -0800</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/50-guid.html</guid>
    
</item>
<item>
    <title>ajp-wsgi</title>
    <link>http://www.saddi.com/software/news/archives/49-ajp-wsgi.html</link>
            <category>Python</category>
    
    <comments>http://www.saddi.com/software/news/archives/49-ajp-wsgi.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=49</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=49</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    I moved all the WSGI stuff out of my AJP C library project into its own project: ajp-wsgi. I polished it up a bit, gave it a command-line interface, wrote a better build system, and even wrote a simple README for it. You can find it &lt;a href=&quot;ftp://ftp.saddi.com/pub/software/ajp-wsgi-0.2.tar.bz2&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Note that this is &lt;em&gt;not&lt;/em&gt; a Python extension. Rather, it is a 100% C WSGI implementation... that executes the application in an embedded Python interpreter. &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s moved beyond a proof-of-concept and is quickly becoming more and more practical. (At this moment, my personal wiki is running atop it. Maybe I&#039;ll switch my Trac sites and shorten over to it as well.) But make no mistake, it is very much alpha-quality and untested. &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Future directions:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Decouple the WSGI code from AJP, opening it up to an SCGI implementation. I have &lt;strong&gt;no&lt;/strong&gt; interest in making a FastCGI version, so don&#039;t ask.&lt;/li&gt;&lt;li&gt;If not thread pooling, then maybe a thread limit at least?&lt;/li&gt;&lt;li&gt;Multi-app support. Maybe read configuration from an INI-style file (each section header would define the module:object for the app).&lt;/li&gt;&lt;li&gt;Figure out/understand the oddity with mod_proxy_ajp. It seems to stream the request body whether solicited or not. It also sends an unsolicited EOF packet. If this is the case, then mod_jk seems like a saner implementation... but maybe this is the future direction of the protocol?&lt;/li&gt;&lt;/ul&gt; 
    </content:encoded>

    <pubDate>Tue, 12 Dec 2006 23:58:04 -0800</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/49-guid.html</guid>
    
</item>
<item>
    <title>It's alive!</title>
    <link>http://www.saddi.com/software/news/archives/48-Its-alive!.html</link>
            <category>Python</category>
    
    <comments>http://www.saddi.com/software/news/archives/48-Its-alive!.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=48</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=48</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    A continuation from &lt;a href=&quot;http://www.saddi.com/software/news/archives/47-Another-AJP-implementation.html&quot;&gt;the weekend&#039;s entry&lt;/a&gt;... I actually finished the WSGI implementation in C and glued it to the AJP library I wrote. It was an interesting endeavor... programming for Python in C.&lt;br /&gt;
&lt;br /&gt;
I was going to cop out and just implement wsgi.input in Python, but I went all the way and wrote that in C as well. And I&#039;m glad too, because it&#039;s far more efficient. Data copies are &lt;em&gt;greatly&lt;/em&gt; minimized. And data is streamed from the server. Assuming the application reads wsgi.input in decent-sized chunks, the memory usage will always remain manageable. (For example, I uploaded a 600+ MB file and hashed it. The server never used more than 2-3MB of memory.)&lt;br /&gt;
&lt;br /&gt;
And from my braindead (i.e. &quot;Hello World!&quot;) benchmarks, the server is capable of about 900 requests per second. This is a 10X improvement compared to the pure-Python server serving the same application. Not bad at all.&lt;br /&gt;
&lt;br /&gt;
I&#039;m glad to say that as far as I can tell, the server is pretty close to 100% WSGI compliance. At least, &lt;code&gt;wsgiref.validate&lt;/code&gt; doesn&#039;t complain. &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; One thing I haven&#039;t tested is its ability to handle erroneous WSGI applications. But I&#039;m not sure if I&#039;ll want to do much validation (e.g. are the header names/values strings? Is the status code/reason code a string?). My goal is to make &lt;em&gt;this&lt;/em&gt; server a production-grade server... so it will assume that your application is WSGI compliant itself.&lt;br /&gt;
&lt;br /&gt;
Anyhow, still a bit of work to do. It would be nice if it was configurable somehow. Also, I should probably investigate if I can just turn it into a simple Python extension module (vs. being a C server that embeds a Python interpreter). I haven&#039;t looked how the hybrid FastCGI servers are packaged, but I&#039;m sure it&#039;s something much more sane than the route I went. &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; 
    </content:encoded>

    <pubDate>Mon, 11 Dec 2006 22:54:21 -0800</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/48-guid.html</guid>
    
</item>
<item>
    <title>Another AJP implementation</title>
    <link>http://www.saddi.com/software/news/archives/47-Another-AJP-implementation.html</link>
            <category>General</category>
            <category>Python</category>
    
    <comments>http://www.saddi.com/software/news/archives/47-Another-AJP-implementation.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=47</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=47</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    There don&#039;t seem to be many AJP C libraries. In fact, there don&#039;t seem to be any (according to Google, at least). There&#039;s at least one FastCGI C library, which is unsurprising given the ubiquity of FastCGI. So yesterday afternoon, I decided to &quot;read spec, write code&quot; yet again and began a C implementation of the &quot;container&quot; (app server) side of AJP. After not having touched C for over 2-3 years, it was a good feeling to muck around with C and BSD sockets again. (Procedural programming, how I missed you!)&lt;br /&gt;
&lt;br /&gt;
I finished it up in a few hours and it is now fairly complete. It&#039;s actually a pretty simple protocol, I&#039;ve realized. All the complexity comes from the way requests/responses are encoded and decoded. (Otherwise, it&#039;s a fairly straightforward 1:1 mapping.)&lt;br /&gt;
&lt;br /&gt;
Of course there were the 3 undocumented spec additions, the first two I had to figure out through experimentation so long ago and the last was conveyed to me by someone who actually looked at the source mod_jk/mod_proxy_ajp source. (As much as I believe in the whole &quot;the best documentation is the source&quot; thing, I don&#039;t really like looking at similar/related source code when implementing something.)&lt;br /&gt;
&lt;br /&gt;
Anyhow, I don&#039;t think those 3 undocumented additions are documented anywhere (hah!) besides my source (ajp_base.py and ajp.c). So:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;When decoding strings, a string with the length of 0xffff is the same as the empty string. However, its trailing NUL is not in the stream.&lt;/li&gt;&lt;li&gt;When sending SEND_BODY_CHUNK packets, the packets must be NUL terminated. However, this NUL must not be included in the SEND_BODY_CHUNK&#039;s length (but must be included in the packet&#039;s length).&lt;/li&gt;&lt;li&gt;The value following an SSL_KEY_SIZE attribute is not an encoded string, but rather an AJP integer.&lt;/li&gt;&lt;/ul&gt;Anyway, the ultimate goal of this project is to create a Python WSGI AJP server that is implemented in C as much as possible. At this point, I have a simple proof-of-concept working that makes calls into an embedded Python interpreter. It doesn&#039;t implement WSGI at all though.&lt;br /&gt;
&lt;br /&gt;
As far as request/response throughput is concerned, it looks promising. While the threaded pure-Python AJP server could only handle ~86 requests per second (with 100 parallel clients), the threaded C/Python hybrid version was nearly pushing 1000 requests per second. Of course it doesn&#039;t include WSGI overhead yet. But we shall see.&lt;br /&gt;
&lt;br /&gt;
All this effort is, of course, inspired by the WSGI servers built upon the FastCGI C library: &lt;a href=&quot;http://cheeseshop.python.org/pypi/fcgiapp/1.4&quot;&gt;fcgiapp&lt;/a&gt; and &lt;a href=&quot;http://cheeseshop.python.org/pypi/python-fastcgi/1.1&quot;&gt;python-fastcgi&lt;/a&gt;. If I actually &lt;em&gt;used&lt;/em&gt; FastCGI, I&#039;d probably be using one of those servers rather than flup&#039;s. &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; 
    </content:encoded>

    <pubDate>Sun, 10 Dec 2006 15:20:28 -0800</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/47-guid.html</guid>
    
</item>
<item>
    <title>Another Python wish-list</title>
    <link>http://www.saddi.com/software/news/archives/46-Another-Python-wish-list.html</link>
            <category>Python</category>
    
    <comments>http://www.saddi.com/software/news/archives/46-Another-Python-wish-list.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=46</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=46</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    While thinking about how I&#039;m going to implement security in &lt;a href=&quot;http://www.saddi.com/software/flannel/&quot;&gt;flannel&lt;/a&gt;, I thought: it would be nice to be able to reuse all the WSGI auth middleware out there. (Really, coming up with my own auth scheme to fit within flannel&#039;s framework did not seem very appealing.)&lt;br /&gt;
&lt;br /&gt;
But it seems, you either protect the entire application, or you don&#039;t. Nothing so far that I&#039;ve seen lets you protect only certain URL patterns. So generalizing upon this, it would be nice to have:&lt;br /&gt;
&lt;blockquote&gt;A conditional filter-type middleware that will accept: a bunch of URL patterns and a middleware instance. If the PATH_INFO matches any of the URL patterns, the middleware is invoked... otherwise the request is passed directly to the application. One can build more complex conditional behavior by composing different instances of this filter middleware.&lt;/blockquote&gt;And it would be nice if the pattern language were something simple, like Ant-style path pattern matching. Other nice-to-have features would be pluggable pattern matchers (maybe people would rather use regexes... who knows?), a caching decorator for pattern matchers.&lt;br /&gt;
&lt;br /&gt;
Another wish-list item I had, which is somewhat also security-related:&lt;br /&gt;
&lt;blockquote&gt;&quot;Remember Me&quot; middleware: This would be similar to &lt;a href=&quot;http://pythonpaste.org/module-paste.auth.cookie.html&quot;&gt;&lt;code&gt;paste.auth.cookie&lt;/code&gt;&lt;/a&gt; but the cookies would be explicitly persistent. Perhaps signing the username + random junk and stuffing this (along with the signature) into a persistent cookie.&lt;/blockquote&gt;A nice-to-have feature would be including the date the cookie was created into the signed data. This would allow some sort of &quot;expire all persistent login data&quot; feature.&lt;br /&gt;
&lt;br /&gt;
Anyway, stuff to work on if I have time and it interests me enough. I haven&#039;t been doing much lately because I haven&#039;t been feeling well. A shame though, that a little illness would utterly stop all my Python/flannel momentum. &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; 
    </content:encoded>

    <pubDate>Wed, 06 Dec 2006 15:37:25 -0800</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/46-guid.html</guid>
    
</item>
<item>
    <title>QUERY_STRING changes to servers, API changes to GzipMiddleware, future changes</title>
    <link>http://www.saddi.com/software/news/archives/45-QUERY_STRING-changes-to-servers,-API-changes-to-GzipMiddleware,-future-changes.html</link>
            <category>flup</category>
    
    <comments>http://www.saddi.com/software/news/archives/45-QUERY_STRING-changes-to-servers,-API-changes-to-GzipMiddleware,-future-changes.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=45</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=45</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    In an effort to quell a warning from &lt;a href=&quot;http://peak.telecommunity.com/wsgiref_docs/module-wsgiref.validate.html&quot;&gt;wsgiref&#039;s validator&lt;/a&gt;, QUERY_STRING will now default to an empty string if it doesn&#039;t exist in the environ. Despite not being required to always be present by the WSGI spec, it looks like the cgi module will assume sys.argv[1] is the query string if QUERY_STRING isn&#039;t present in the environ.&lt;br /&gt;
&lt;br /&gt;
Also, I changed the keyword parameters in GzipMiddleware a bit:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;mimeTypes -&gt; mime_types&lt;/li&gt;&lt;li&gt;compresslevel -&gt; compress_level&lt;/li&gt;&lt;/ul&gt;Lastly, unless I hear from people otherwise, I will be removing &lt;code&gt;flup.publisher&lt;/code&gt; and &lt;code&gt;flup.resolver&lt;/code&gt; from flup.&lt;br /&gt;
&lt;br /&gt;
And as far as &lt;code&gt;flup.middleware&lt;/code&gt; goes, ErrorMiddleware will be disappearing as well. There are better options from &lt;a href=&quot;http://pythonpaste.org/&quot;&gt;Paste&lt;/a&gt;, especially &lt;a href=&quot;http://pythonpaste.org/module-paste.evalexception.html&quot;&gt;&lt;code&gt;paste.evalexception&lt;/code&gt;&lt;/a&gt; for development. GzipMiddleware and SessionMiddleware are now currently looking for a new home, as I would like to remove them from flup eventually too. 
    </content:encoded>

    <pubDate>Tue, 05 Dec 2006 14:15:51 -0800</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/45-guid.html</guid>
    
</item>
<item>
    <title>flannel beginnings</title>
    <link>http://www.saddi.com/software/news/archives/44-flannel-beginnings.html</link>
            <category>flannel</category>
    
    <comments>http://www.saddi.com/software/news/archives/44-flannel-beginnings.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=44</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=44</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    You know a project is getting serious when you create a &lt;a href=&quot;http://trac.saddi.com/flannel&quot;&gt;Trac site&lt;/a&gt; and a &lt;a href=&quot;http://www.saddi.com/software/news/categories/6-flannel&quot;&gt;blog category&lt;/a&gt; for it. &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
So I&#039;ve been hammering away at this thing for the past 3-4 days. I&#039;m surprised to say that it&#039;s actually in a working state now. Maybe functional enough to be classified as a &#039;toy&#039; web framework? &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; Well, I suppose I need to finish more components first, since having only text fields for form input could get quite frustrating.&lt;br /&gt;
&lt;br /&gt;
But the basics are all there... component rendering, event triggers, parameter binding (both by value &lt;i&gt;and&lt;/i&gt; by reference), automatic persistence of session data.&lt;br /&gt;
&lt;br /&gt;
Time to polish it, add more components, refine the interfaces. But I wonder... do I ever really want to &lt;em&gt;publish&lt;/em&gt; it? Make it widely available? Document and &lt;em&gt;support&lt;/em&gt; it?&lt;br /&gt;
&lt;br /&gt;
Hmmm... I don&#039;t know.&lt;br /&gt;
&lt;br /&gt;
But for now, I&#039;d rather write code. 
    </content:encoded>

    <pubDate>Wed, 29 Nov 2006 14:52:58 -0800</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/44-guid.html</guid>
    
</item>
<item>
    <title>A new project...</title>
    <link>http://www.saddi.com/software/news/archives/43-A-new-project....html</link>
            <category>Python</category>
    
    <comments>http://www.saddi.com/software/news/archives/43-A-new-project....html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=43</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=43</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    Related to a &lt;a href=&quot;http://www.saddi.com/software/news/archives/41-Python-wish-list.html&quot;&gt;recent entry&lt;/a&gt; I&#039;ve made, I started thinking about a Python port (at least in concept) of &lt;a href=&quot;http://tapestry.apache.org/&quot;&gt;Tapestry&lt;/a&gt;. Rather than go for the template/spec/class approach of Tapestry 4, I opted to go for the wholly annotation-based approach of Tapestry 5 (still in development) thus eliminating the need for a spec file.&lt;br /&gt;
&lt;br /&gt;
Annotating methods/functions in Python is pretty simple, just use decorators. Annotating member variables, on the other hand, seemed non-trivial. But then I remembered ORMs like SQLObject and SQLAlchemy and that gave me an idea. However, it would require metaclass magic...&lt;br /&gt;
&lt;br /&gt;
So when I woke up this morning, I grabbed my laptop and started hacking away at a proof-of-concept (while still in bed!) Many hours later (and I did get out of bed, eventually), I had most of the metaclass infrastructure for &lt;em&gt;flannel&lt;/em&gt; done. Yes, &lt;em&gt;flannel&lt;/em&gt;. (I&#039;m entertaining ideas for a better name though.)&lt;br /&gt;
&lt;br /&gt;
So now I can easily mark variables as a persistent, transient, or parameter type. And the variables will be magically transformed into a Python property with my own setters and getters. Also, I can mark methods with certain &quot;lifecycle decorators&quot; which defines when during the rendering cycle they should be called. Basically something like:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;class MyComponent(BaseComponent):&lt;br /&gt;
&amp;#160;&amp;#160;value1 = Persistent()&lt;br /&gt;
&amp;#160;&amp;#160;value2 = Transient(42)&lt;br /&gt;
&amp;#160;&amp;#160;param1 = Parameter(&#039;foo&#039;)&lt;br /&gt;
&amp;#160;&amp;#160;param2 = Parameter(required=True)&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;@setup_render&lt;br /&gt;
&amp;#160;&amp;#160;def do_something(self, out):&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;pass&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
Transient variables don&#039;t really need to be annotated... but doing so allows them to be reset to an initial value at the start of a processing cycle. Speaking of which, if you aren&#039;t familiar with Tapestry, the abbreviated request/response cycle I&#039;m aiming for looks something like:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Figure out which page/component the request was targetting via PATH_INFO.&lt;br /&gt;
&lt;li&gt;Get an instance of the page from the pool.&lt;br /&gt;
&lt;li&gt;Restore persistent variables from storage (typically the session), reset transient variables to their initial values, bind parameter variables and ensure all required parameter variables are bound.&lt;br /&gt;
&lt;li&gt;Render the page! (Which recursively renders components within.)&lt;br /&gt;
&lt;li&gt;Save persistent variables to storage.&lt;br /&gt;
&lt;li&gt;Return page to pool.&lt;br /&gt;
&lt;/ol&gt;Actions or pages with forms would require slightly different handling, which I haven&#039;t thought about yet. Form handling, I think, is the strength of these event-driven frameworks... so I&#039;m aiming to get it right. &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; Basically you &quot;bind&quot; input components (like text fields, checkboxes, etc.) to properties or even property paths and give it an &quot;event handler&quot; to call when the form is submitted. When your event handler is called, you can expect the properties to reflect the user input.&lt;br /&gt;
&lt;br /&gt;
Anyhow, a significant (and unfortunate, I think) part of this project will involve coming up with yet another templating engine. However, it should be a fairly simple tag-based system, since most of the functionality will actually be implemented by components.&lt;br /&gt;
&lt;br /&gt;
It will be interesting. Though I don&#039;t expect to take this project very seriously. But maybe if/when I actually get it to where I want it to be, I&#039;ll change my mind. 
    </content:encoded>

    <pubDate>Sat, 25 Nov 2006 19:09:38 -0800</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/43-guid.html</guid>
    
</item>

</channel>
</rss>