<?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>Python Blog - All about python</title>
	<atom:link href="http://www.python-blog.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.python-blog.com</link>
	<description>and technologies around</description>
	<lastBuildDate>Tue, 27 Jul 2010 19:58:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>hg app v0.8 new layout, and features</title>
		<link>http://www.python-blog.com/2010/07/27/hg-app-v0-8-new-layout-and-features/</link>
		<comments>http://www.python-blog.com/2010/07/27/hg-app-v0-8-new-layout-and-features/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 19:55:34 +0000</pubDate>
		<dc:creator>Marcin Kuźmiński</dc:creator>
				<category><![CDATA[Mercurial]]></category>
		<category><![CDATA[Pylons]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[hg app demo]]></category>
		<category><![CDATA[hgweb pylons]]></category>
		<category><![CDATA[hgwebdir alternative]]></category>
		<category><![CDATA[pylons demo of hg app]]></category>
		<category><![CDATA[pylons hgwebdir replacement demo]]></category>

		<guid isPermaLink="false">http://www.python-blog.com/?p=314</guid>
		<description><![CDATA[It&#8217;s been some time, hg-app is still in rapid development.
DEMO: http://hg.python-works.com
TRACKER: http://bitbucket.org/marcinkuzminski/hg-app/issues 
Since last time hg-app got:

Full permissions per repository system.
Yui float graphs
New gui
Database based settings and hooks
Huge number of bugfixes.

Below few screenshots of new hg-app gui.
]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been some time, hg-app is still in rapid development.</p>
<h2>DEMO: <a href="http://hg.python-works.com/">http://hg.python-works.com</a></h2>
<h2>TRACKER: <a href="http://bitbucket.org/marcinkuzminski/hg-app/issues">http://bitbucket.org/marcinkuzminski/hg-app/issues</a> </h2>
<p>Since last time hg-app got:</p>
<ul>
<li>Full permissions per repository system.</li>
<li>Yui float graphs</li>
<li>New gui</li>
<li>Database based settings and hooks</li>
<li>Huge number of bugfixes.</li>
</ul>
<p>Below few screenshots of new hg-app gui.
<a href='http://www.python-blog.com/2010/07/27/hg-app-v0-8-new-layout-and-features/screenshot-2/' title='Screenshot'><img width="150" height="150" src="http://www.python-blog.com/wp-content/uploads/2010/07/Screenshot1-150x150.png" class="attachment-thumbnail" alt="" title="Screenshot" /></a>
<a href='http://www.python-blog.com/2010/07/27/hg-app-v0-8-new-layout-and-features/screenshot-1/' title='Screenshot-1'><img width="150" height="150" src="http://www.python-blog.com/wp-content/uploads/2010/07/Screenshot-1-150x150.png" class="attachment-thumbnail" alt="" title="Screenshot-1" /></a>
<a href='http://www.python-blog.com/2010/07/27/hg-app-v0-8-new-layout-and-features/screenshot-2-2/' title='Screenshot-2'><img width="150" height="150" src="http://www.python-blog.com/wp-content/uploads/2010/07/Screenshot-2-150x150.png" class="attachment-thumbnail" alt="" title="Screenshot-2" /></a>
<a href='http://www.python-blog.com/2010/07/27/hg-app-v0-8-new-layout-and-features/screenshot-3/' title='Screenshot-3'><img width="150" height="150" src="http://www.python-blog.com/wp-content/uploads/2010/07/Screenshot-3-150x150.png" class="attachment-thumbnail" alt="" title="Screenshot-3" /></a>
<a href='http://www.python-blog.com/2010/07/27/hg-app-v0-8-new-layout-and-features/screenshot-4/' title='Screenshot-4'><img width="150" height="150" src="http://www.python-blog.com/wp-content/uploads/2010/07/Screenshot-4-150x150.png" class="attachment-thumbnail" alt="" title="Screenshot-4" /></a>
<a href='http://www.python-blog.com/2010/07/27/hg-app-v0-8-new-layout-and-features/screenshot-5/' title='Screenshot-5'><img width="150" height="150" src="http://www.python-blog.com/wp-content/uploads/2010/07/Screenshot-5-150x150.png" class="attachment-thumbnail" alt="" title="Screenshot-5" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.python-blog.com/2010/07/27/hg-app-v0-8-new-layout-and-features/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>hg app &#8211; demo</title>
		<link>http://www.python-blog.com/2010/06/07/hg-app-demo/</link>
		<comments>http://www.python-blog.com/2010/06/07/hg-app-demo/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 18:18:32 +0000</pubDate>
		<dc:creator>Marcin Kuźmiński</dc:creator>
				<category><![CDATA[Mercurial]]></category>
		<category><![CDATA[Pylons]]></category>
		<category><![CDATA[hg app demo]]></category>
		<category><![CDATA[pylons demo of hg app]]></category>
		<category><![CDATA[pylons hgwebdir replacement demo]]></category>

		<guid isPermaLink="false">http://www.python-blog.com/?p=310</guid>
		<description><![CDATA[After some code fixups, and corrections i manage to set up a working demo of hg app.
This demo, has all functionality of hg app and will be updated during application life to current version.
Demo is available at http://hg.python-works.com
Any feedback is welcomed and can be posted to http://bitbucket.org/marcinkuzminski/hg-app/issues
Thank you !
]]></description>
			<content:encoded><![CDATA[<p>After some code fixups, and corrections i manage to set up a working demo of hg app.<br />
This demo, has all functionality of hg app and will be updated during application life to current version.</p>
<h2>Demo is available at <a href="http://hg.python-works.com">http://hg.python-works.com</a></h2>
<p>Any feedback is welcomed and can be posted to <a href="http://bitbucket.org/marcinkuzminski/hg-app/issues">http://bitbucket.org/marcinkuzminski/hg-app/issues</a></p>
<p>Thank you !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.python-blog.com/2010/06/07/hg-app-demo/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>hg app &#8211; mercurial hgwebdir replacement.</title>
		<link>http://www.python-blog.com/2010/06/01/hg-app-mercurial-hgwebdir-replacement/</link>
		<comments>http://www.python-blog.com/2010/06/01/hg-app-mercurial-hgwebdir-replacement/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 18:41:44 +0000</pubDate>
		<dc:creator>Marcin Kuźmiński</dc:creator>
				<category><![CDATA[Mercurial]]></category>
		<category><![CDATA[Pylons]]></category>
		<category><![CDATA[SqlAlchemy]]></category>
		<category><![CDATA[Threads]]></category>
		<category><![CDATA[hgweb alternative]]></category>
		<category><![CDATA[hgweb templates]]></category>
		<category><![CDATA[hgwebdir replacement]]></category>
		<category><![CDATA[mercurial web]]></category>
		<category><![CDATA[pylons mercurial]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://www.python-blog.com/?p=297</guid>
		<description><![CDATA[Since, me and Lukasz fine tuned the vcs library i manage to setup a beta version of hg app. I was tired of the boring looks, and poor source code browsing capabilities of the hgwebdir.
So i started to write my own app, at the beginning it was just a simple hgwebdir wrapper, to pylons, now [...]]]></description>
			<content:encoded><![CDATA[<p>Since, me and Lukasz fine tuned the <a href="http://bitbucket.org/marcinkuzminski/vcs">vcs</a> library i manage to setup a beta version of <a href="http://bitbucket.org/marcinkuzminski/hg-app/">hg app</a>. I was tired of the boring looks, and poor source code browsing capabilities of the hgwebdir.<br />
So i started to write my own app, at the beginning it was just a simple hgwebdir wrapper, to pylons, now it&#8217;s fully standalone replacement. Including abilities to push/pull thrum the application.</p>
<p>Pylons based replacement for hgwebdir. Fully customizable,<br />
with authentication, permissions. Based on vcs library.</p>
<ul>
<li> has it&#8217;s own middleware to handle mercurial protocol request each request can<br />
be logged and authenticated +threaded performance unlikely to hgweb. Middleware recognises a mercurial protocol<br />
and skips any functionality for pure web request</li>
<li>mimics full functionality of hgwebdir including feeds,archives,diffs,raw-diffs,annotations,file history etc.</li>
<li> mako templates let&#8217;s you customize look and feel of the application.<br />
Possibly visual merge with your company systems</li>
<li>diffs annotations and source code all colored by pygments (see screenshots).</li>
<li> admin interface for performing user/permission managements as well as repository<br />
managements. Out of beta version should have fully customizable permission system, with<br />
private repos, and repo permissions</li>
<li> added cache with invalidation on push/repo managment for high performance and<br />
always upto date data.</li>
<li> rss / atom feeds</li>
<li> future support for git (thanks to vcs mercurial/git api should be 1:1</li>
<li> based on pylons 1.0 / sqlalchemy 0.6 /sqlite(possibly mysql/postgres thanks to sqlalchemy models)</li>
</ul>
<p>Below are the beta version screenshots. Now I&#8217;m not good at designing webapps, so excuse me if you feel the look&amp;feel to be to simple or bad looking.<br />
It&#8217;s all i could come up with. Most of my expiration was taken from hgwebdir/bitbucket and github. I tried to take all best parts from all of them and combine into this app.<br />
It&#8217;s still in beta but i think it&#8217;s production ready in this stage I&#8217;m using it for few weeks, and had no troubles or crashes with it. The code can be grabbed at bitbucket repo <a href="http://bitbucket.org/marcinkuzminski/hg-app/">http://bitbucket.org/marcinkuzminski/hg-app/</a></p>

<a href='http://www.python-blog.com/2010/06/01/hg-app-mercurial-hgwebdir-replacement/screenshot-administration-namoroka/' title='Screenshot-Administration - Namoroka'><img width="150" height="150" src="http://www.python-blog.com/wp-content/uploads/2010/06/Screenshot-Administration-Namoroka-150x150.png" class="attachment-thumbnail" alt="" title="Screenshot-Administration - Namoroka" /></a>
<a href='http://www.python-blog.com/2010/06/01/hg-app-mercurial-hgwebdir-replacement/screenshot-file-annotate-namoroka/' title='Screenshot-File annotate - Namoroka'><img width="150" height="150" src="http://www.python-blog.com/wp-content/uploads/2010/06/Screenshot-File-annotate-Namoroka-150x150.png" class="attachment-thumbnail" alt="" title="Screenshot-File annotate - Namoroka" /></a>
<a href='http://www.python-blog.com/2010/06/01/hg-app-mercurial-hgwebdir-replacement/screenshot-python-works-mercurial-repositories-namoroka/' title='Screenshot-Python-works Mercurial Repositories - Namoroka'><img width="150" height="150" src="http://www.python-blog.com/wp-content/uploads/2010/06/Screenshot-Python-works-Mercurial-Repositories-Namoroka-150x150.png" class="attachment-thumbnail" alt="" title="Screenshot-Python-works Mercurial Repositories - Namoroka" /></a>
<a href='http://www.python-blog.com/2010/06/01/hg-app-mercurial-hgwebdir-replacement/screenshot-python-works-mercurial-repositories-namoroka-1/' title='Screenshot-Python-works Mercurial Repositories - Namoroka-1'><img width="150" height="150" src="http://www.python-blog.com/wp-content/uploads/2010/06/Screenshot-Python-works-Mercurial-Repositories-Namoroka-1-150x150.png" class="attachment-thumbnail" alt="" title="Screenshot-Python-works Mercurial Repositories - Namoroka-1" /></a>
<a href='http://www.python-blog.com/2010/06/01/hg-app-mercurial-hgwebdir-replacement/screenshot-repository-managment-namoroka/' title='Screenshot-Repository managment - Namoroka'><img width="150" height="150" src="http://www.python-blog.com/wp-content/uploads/2010/06/Screenshot-Repository-managment-Namoroka-150x150.png" class="attachment-thumbnail" alt="" title="Screenshot-Repository managment - Namoroka" /></a>
<a href='http://www.python-blog.com/2010/06/01/hg-app-mercurial-hgwebdir-replacement/screenshot-repository-managment-namoroka-1/' title='Screenshot-Repository managment - Namoroka-1'><img width="150" height="150" src="http://www.python-blog.com/wp-content/uploads/2010/06/Screenshot-Repository-managment-Namoroka-1-150x150.png" class="attachment-thumbnail" alt="" title="Screenshot-Repository managment - Namoroka-1" /></a>
<a href='http://www.python-blog.com/2010/06/01/hg-app-mercurial-hgwebdir-replacement/screenshot-repository-managment-namoroka-2/' title='Screenshot-Repository managment - Namoroka-2'><img width="150" height="150" src="http://www.python-blog.com/wp-content/uploads/2010/06/Screenshot-Repository-managment-Namoroka-2-150x150.png" class="attachment-thumbnail" alt="" title="Screenshot-Repository managment - Namoroka-2" /></a>

]]></content:encoded>
			<wfw:commentRss>http://www.python-blog.com/2010/06/01/hg-app-mercurial-hgwebdir-replacement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VersionControlSystem &#8211; a great Mercurial API.</title>
		<link>http://www.python-blog.com/2010/05/02/versioncontrolsystem-a-great-mercurial-api/</link>
		<comments>http://www.python-blog.com/2010/05/02/versioncontrolsystem-a-great-mercurial-api/#comments</comments>
		<pubDate>Sat, 01 May 2010 23:25:33 +0000</pubDate>
		<dc:creator>Marcin Kuźmiński</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Mercurial]]></category>
		<category><![CDATA[Pylons]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[django hgserve]]></category>
		<category><![CDATA[git api]]></category>
		<category><![CDATA[hgwebdir replace]]></category>
		<category><![CDATA[mercurial api]]></category>
		<category><![CDATA[pylons hgserve]]></category>
		<category><![CDATA[simple api]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://www.python-blog.com/?p=293</guid>
		<description><![CDATA[Since Me and Lukasz started this project a while ago, it&#8217;s time to announce that we shipped out first public Beta release.
It&#8217;s available on PyPi as &#8220;vcs&#8221;, so you can install it using PIP or EASY_INSTALL.
Simply run to download and install it.
easy_install vcs
pip install vcs

Lukasz made a nice documentation, and quick starts available here http://packages.python.org/vcs/
The [...]]]></description>
			<content:encoded><![CDATA[<p>Since Me and Lukasz started this project a while ago, it&#8217;s time to announce that we shipped out first public Beta release.</p>
<p>It&#8217;s available on PyPi as &#8220;vcs&#8221;, so you can install it using PIP or EASY_INSTALL.</p>
<p>Simply run to download and install it.</p>
<pre>easy_install vcs
pip install vcs
</pre>
<p>Lukasz made a nice documentation, and quick starts available here <a href="http://packages.python.org/vcs/" target="_blank">http://packages.python.org/vcs/</a></p>
<p><strong>The vcs API:</strong></p>
<p><strong>Features</strong></p>
<ul>
<li>Common <em>API</em> for SCM backends (mercurial is the first and only one available right now)</li>
<li>Fetching repositories data lazily (performance and easy of use)</li>
<li>Simple caching mechanism so we don&#8217;t hit repo too often (so a refresh on a 2000 commit repo wont kill  the cpu)</li>
</ul>
<p><strong>Incoming</strong></p>
<ul>
<li><a href="http://www.djangoproject.com/">Django</a> app for <a href="http://mercurial.selenic.com/">mercurial</a> hgserve replacement &#8211; this is probably going to be a part of the vcs library</li>
<li><a href="http://pylonshq.com/">Pylons</a> app for <a href="http://mercurial.selenic.com/">mercurial</a> replacement &#8211; this is my little project which i finished roughly in 70% of functionality that hgwebdir does.</li>
<li>Command line client</li>
</ul>
<p>Few things are worth mentioning.<br />
The key point of vcs to have the same api for various SCM-s so mercurial,git,subversion(maybe others) will have<br />
a same way for data access,objects structures and so on. Imagine how fast and simple you could extend an web app which uses<br />
mercurial as a SCM to GIT, simply replace the repo path to git and all should work. Of Course there are some differences between git and mercurial<br />
that could be handled in the same maner, and this is also simply handled by a private methods, specific for a SCM.</p>
<p>This is of course an open source project and any contributors are always welcomed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.python-blog.com/2010/05/02/versioncontrolsystem-a-great-mercurial-api/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SqlAlchemy 0.6 and SqlAlchemy model generator</title>
		<link>http://www.python-blog.com/2010/04/22/sqlalchemy-0-6-and-sqlalchemy-model-generator/</link>
		<comments>http://www.python-blog.com/2010/04/22/sqlalchemy-0-6-and-sqlalchemy-model-generator/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 22:32:19 +0000</pubDate>
		<dc:creator>Marcin Kuźmiński</dc:creator>
				<category><![CDATA[SqlAlchemy]]></category>
		<category><![CDATA[c-extensions]]></category>
		<category><![CDATA[sqlalchemy 0.6]]></category>
		<category><![CDATA[sqlalchemy model generator]]></category>

		<guid isPermaLink="false">http://www.python-blog.com/?p=289</guid>
		<description><![CDATA[Few days ago there&#8217;s been a mayor release of SqlAlchemy.
There are a lot of bugfixes new features in tis release, but four things
are worth mentioning in this major release. ]]></description>
			<content:encoded><![CDATA[<p>Few days ago there&#8217;s been a mayor release of SqlAlchemy.<br />
There are a lot of bugfixes new features in tis release, but four things<br />
are worth mentioning in this major release. <a href="http://www.sqlalchemy.org/trac/wiki/06Migration/>See here for all changes</a></p>
<p>- C Extensions for Result Fetching according to creators will give extra 20% performance to the 30% already gained due to in-python enhancements<br />
( but you have to compile it yourself)</p>
<pre>python setup.py --with-cextensions install</pre>
<p>- Implemented well known and proven <a href="http://beaker.groovie.org/">Beaker</a> caching for Query.<br />
- RETURNING Support on insert, update and delete &#8211; might come in very handy.<br />
- Pickable query result. Means sqlAlchemy objects could be kept in sessions (did not check that)</p>
<p>After some checks i decided to move my projects to the new version, since i did that i needed to<br />
update my <a href="http://bitbucket.org/marcinkuzminski/sqlalchemy_model_generator/">model generator for SqlAlchemy</a> it&#8217;s been rewritten for sqlalchemy 0.6<br />
and now works with 0.5 and 0.6 versions. Additionally i made some small fixes i found. Any feedback is welcomed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.python-blog.com/2010/04/22/sqlalchemy-0-6-and-sqlalchemy-model-generator/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>what i missed about easy install</title>
		<link>http://www.python-blog.com/2010/03/14/what-i-missed-about-easy-install/</link>
		<comments>http://www.python-blog.com/2010/03/14/what-i-missed-about-easy-install/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 13:34:52 +0000</pubDate>
		<dc:creator>Marcin Kuźmiński</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[easy install supplement]]></category>
		<category><![CDATA[easy_install]]></category>
		<category><![CDATA[PyPi listings]]></category>
		<category><![CDATA[upgrade packages]]></category>
		<category><![CDATA[yolk]]></category>

		<guid isPermaLink="false">http://www.python-blog.com/?p=284</guid>
		<description><![CDATA[I love Setuptools, and easy_install. Since most of my time i work on virtualenv, I&#8217;m using setuptools quite frequently, but
few things i always missed about easy install,and I&#8217;m not going to write here what easy_install is missing, but rather how to
make it more flexible. The great tool i found recently on some python forum is [...]]]></description>
			<content:encoded><![CDATA[<p>I love Setuptools, and easy_install. Since most of my time i work on <a href="http://pypi.python.org/pypi/virtualenv">virtualenv,</a> I&#8217;m using setuptools quite frequently, but<br />
few things i always missed about easy install,and I&#8217;m not going to write here what easy_install is missing, but rather how to<br />
make it more flexible. The great tool i found recently on some python forum is <a href="http://pypi.python.org/pypi/yolk/" target="_blank"><strong>yolk</strong></a>.</p>
<p>Yolk is &#8220;Command-line tool querying PyPI and Python packages installed on your  system&#8221;<br />
Yolk can list your current environment packages including some useful additional information about them like &#8216;active&#8217; or<br />
&#8216;non-active&#8217; packages, it can list packages that could be upgrade (simply yolk -U).</p>
<p>Before I&#8217;d had to manually search my python path and copy/paste each package to easy_install -U, what was quite annoying.<br />
Now in few seconds i can get the list of upgradable packages and upgrade them.</p>
<p>Another great tool in yolk is PyPI quering. For example:</p>
<pre class="brush:plain">$ yolk -F Paste
     Download source tarball for latest version of Paste to your current directory

$ yolk -F Paste -T svn
     Do a subversion checkout for Paste to a directory named Paste_svn in your current directory.

$ yolk -L 2
     Show list of CheeseShop releases in the last two hours
</pre>
<p>So you can always get the news from PyPI and maybe find some interesting packages.<br />
If your using easy_install i&#8217;m quite sure you will love yolk.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.python-blog.com/2010/03/14/what-i-missed-about-easy-install/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Documenting project using Sphinx</title>
		<link>http://www.python-blog.com/2010/02/21/documenting-project-using-sphinx/</link>
		<comments>http://www.python-blog.com/2010/02/21/documenting-project-using-sphinx/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 17:10:15 +0000</pubDate>
		<dc:creator>Łukasz Balcerzak</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[documentation sphinx]]></category>
		<category><![CDATA[sphinx]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.python-blog.com/?p=257</guid>
		<description><![CDATA[We have no time for creating documentation for our project&#8230; wrong! Documentation and tests are crucial in all software projects. Sure, it is more important that our software would work fine but package of unit tests almost always save time (in future as less bugs are produced) and without documentation shouldn&#8217;t be treated as &#8220;user [...]]]></description>
			<content:encoded><![CDATA[<p>We have no time for creating documentation for our project&#8230; wrong! Documentation and tests are crucial in all software projects. Sure, it is more important that our software would work fine but package of unit tests almost always save time (in future as less bugs are produced) and without documentation shouldn&#8217;t be treated as &#8220;user guide&#8221;.</p>
<p>It doesn&#8217;t matter if you are creating project for your company or you plan to release it as an open source &#8211; by providing documentation you make life easier for other contributors and end-users, of course. And if you know how to write <a href="http://docutils.sourceforge.net/rst.html">restructuredText</a> documents then you already own necessary skills to create documentation lighting fast!</p>
<h2>Prepare!</h2>
<p>First of all, you would need to have <a href="http://docutils.sourceforge.net/rst.html">Distutils</a> and <a href="http://sphinx.pocoo.org/">Sphinx</a> installed. You can install it using one of the Python package management tools, in example <i>easy_install</i> would do the job. I prefer to use <a href="http://pypi.python.org/pypi/pip">pip</a>:</p>
<pre class="brush:bash">
pip install distutils
pip install sphinx
</pre>
<p>Simply use any project you&#8217;d like to create documentation for, I would use <a href="http://bitbucket.org/lukaszb/django-richtemplates/">django-richtemplates</a>. Create a new directory for your documentation and run <i>sphinx-quickstart</i> command:</p>
<pre class="brush:bash">
hg clone https://bitbucket.org/lukaszb/django-richtemplates/ django-richtemplates-temp
cd django-richtemplates-temp
sphinx-quickstart
</pre>
<p>Just answer some questions &#8211; they are very straightforward. You should probably turn <i>autodoc</i> option on.<br />
Sphinx would create some directories for internal usage and static content storage (<i>_build</i>, <i>_static</i> and <i>_templates</i>), configuration file (<i>conf.py</i>) and index file (<i>index.html</i>). Ok, enough of this crap, lets create our first documentation page! </p>
<h2>First page</h2>
<p>Create new file, lets call it <i>installation.rst</i> and write the document itself:</p>
<pre class="brush:plain">
.. _installation:

============
Installation
============

Fake installation for `django-richtemplates`_ project.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur.

.. note::
   Yeah, this would be a note.
   Very simple, indeed.

Some more crap
--------------

If you would like to highlight a code snippet, it is as easy as::

   from mycompany.auth import AuthenticationBackend

   class MyClass(object):
       """
       Docstring.
       """
       def __init__(self, *args, **kwargs):
           """
           Some *business* logic.
           """
           pass
       def authenticate(self, username, password):
           """
           External authentication process.
           """
           auth = AuthenticationBackend(username, password)
           return auth.is_authenticated()

Or choose language explicit:

.. code-block:: bash

   cd django-richtemplates
   sudo python setup.py install

Yeah, `restructuredText <http://docutils.sourceforge.net/rst.html>`_ is great!
And easy, too.

External-internal hyperlinks
----------------------------

You may also use ``sphinx`` features, like linking to other *documents*, like
this: go to :ref:`configuration`.

.. _django-richtemplates: http://bitbucket.org/lukaszb/django-richtemplates/
</pre>
<p>This is standard restructured text document. The only sphinx specific parts are first line (need to add relation with file itself &#8211; this is needed for table of contents generation) and reference to other file (which is done with <i>ref:`configuration`</i>). Yup, we haven&#8217;t created <i>configuration.rst</i> file, yet. So do this now, and paste following:</p>
<pre class="brush:plain">
.. _configuration:

=========================
Configuring richtemplates
=========================

I hope you have already read chapter :ref:`installation`.

Lorem ipsum!
------------

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur.
</pre>
<h2>Don&#8217;t forget about the main page!</h2>
<p>I once hoped that the first page (namely <i>index.rst</i>) is generated automatically, yet, I was wrong. But in order<br />
to supply needed data for sphinx generator you have to make very simple changes to the <i>index.rst</i>. Just add<br />
<i>:glob:</i> option to the <i>toctree</i> directive. Finally, mark that all (<i>*</i>) restructuredText documents should<br />
be used.</p>
<pre class="brush:plain">
.. django-richtemplates documentation master file, created by
   sphinx-quickstart on Sat Feb 20 21:42:53 2010.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to django-richtemplates's documentation!
================================================

Contents:

.. toctree::
   :maxdepth: 2
   :glob:

   *

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
</pre>
<p>Now in <i>mydocs</i> directory run</p>
<pre class="brush:bash">
make html
</pre>
<p>and open file located at <i>mydocs/_build/html/index.html</i>. You should see your documentation!</p>
<h2>Final words</h2>
<p>Ok, this was very simple and the effect is &#8211; for such a little work done &#8211; quite amazing if you&#8217;d ask me.<br />
However, we still haven&#8217;t used <i>autodoc</i> Sphinx&#8217;s extension. Let&#8217;s do that now &#8211; create new file<br />
<i>api.rst</i> and paste whats below:</p>
<pre class="brush:plain">
.. _api:

===
API
===

You can find some basic API information here.

Forms API
---------

In this section we cover some basics about the `django-richtemplates`'s forms
API.

.. automodule:: richtemplates.forms
   :members:

.. _django-richtemplates: http://bitbucket.org/lukaszb/django-richtemplates/
</pre>
<p>Again, run make command and see your documentation. Ok, so where is your API, you ask? Well, if you look at the output<br />
of <i>make html</i> command you&#8217;d see that there was a warning &#8211; <i>richtemplates.forms</i> couldn&#8217;t be found.<br />
Which is completely correct, as Sphinx doesn&#8217;t try to guess where your modules are, you have to configure it by yourself.<br />
Change <i>sys.path</i> by uncommenting existing line and change it to this:</p>
<pre class="brush:python">
sys.path.append(os.path.abspath('..'))
</pre>
<p>If you are not sure why why put <i>..</i> there, it&#8217;s simple &#8211; Sphinx would go a one directory up (<i>..</i>) and try to find <i>richtemplates</i> there. Try to build your documentation now. Warning again? Yeah, Sphinx now complains about not<br />
having <i>DJANGO_SETTINGS_MODULE</i> which is, again, totally correct. As importing <i>richtemplates</i> won&#8217;t<br />
raise exception, but trying to get deeper into the module (<i>richtemplates.forms</i>) would be impossible without<br />
being within Django context (same would happen if you try to run python interpreter and run <i>from django import forms</i>).<br />
So add this line into your <i>conf.py</i> file:</p>
<pre class="brush:python">
os.environ['DJANGO_SETTINGS_MODULE'] = 'django.conf.global_settings'
</pre>
<p>More information about <i>autodoc</i> extension could be found <a href="http://sphinx.pocoo.org/ext/autodoc.html">here</a>.</p>
<p>Hope this would help anyone trying to start with his/her own documentation :)<br />
If you have any suggestions &#8211; let me know.</p>
<p>Take care and make documentation, not war.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.python-blog.com/2010/02/21/documenting-project-using-sphinx/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Pydev alternative</title>
		<link>http://www.python-blog.com/2010/02/10/pydev-alternative/</link>
		<comments>http://www.python-blog.com/2010/02/10/pydev-alternative/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 09:10:21 +0000</pubDate>
		<dc:creator>Marcin Kuźmiński</dc:creator>
				<category><![CDATA[Editors]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[intellij]]></category>
		<category><![CDATA[jetbrains]]></category>
		<category><![CDATA[pycharm]]></category>
		<category><![CDATA[PyDev]]></category>
		<category><![CDATA[rubycharm]]></category>

		<guid isPermaLink="false">http://www.python-blog.com/?p=246</guid>
		<description><![CDATA[makers of a great ruby on rails IDE rubymine, and ever greater Java IDE intelliJ, released
another  (probably) great idea product named pycham, a python IDE, written from scratch in Java.
Since IntelliJ is a really the best Java IDE out there, i presume their next product
dedicated to python will be worth switching.
It&#8217;s still in preview [...]]]></description>
			<content:encoded><![CDATA[<p>makers of a great ruby on rails IDE rubymine, and ever greater Java IDE intelliJ, released<br />
another  (probably) great idea product named pycham, a python IDE, written from scratch in Java.</p>
<p>Since IntelliJ is a really the best Java IDE out there, i presume their next product<br />
dedicated to python will be worth switching.</p>
<p>It&#8217;s still in preview but as for now it provides:</p>
<ul>
<li>Coding Assistance</li>
<li>Project Code Navigation</li>
<li>Google App Engine Support</li>
<li>Code Analysis</li>
<li>Python Refactoring</li>
<li>Web Development with Django (some really nice ones)</li>
<li>debugger</li>
<li>Integrated unit tests</li>
<li>Version control integration</li>
</ul>
<p><a href="http://jetbrains.com"><br />
<img class="alignnone" title="pycharm" src="http://www.jetbrains.com/pycharm/features/screenshots/tour/framed/PC_Hello1.png" alt="" width="325" height="175" /><br />
</a></p>
<p>I&#8217;d tested under linux, seems to be a littler slower than my eclipse home brew version, but I&#8217;d expect the final version faster. It has few nice features, easy configuration, code completion are doing fine.<br />
You can grab a free 45 day copy from <a href="http://www.jetbrains.com/pycharm/index.html" target="_blank">here</a>.</p>
<p>I&#8217;ll for sure fallow this product development. Stay posted for more !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.python-blog.com/2010/02/10/pydev-alternative/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Sqlalchemy model generator on bitbucket</title>
		<link>http://www.python-blog.com/2010/02/09/sqlalchemy-model-generator-on-bitbucket/</link>
		<comments>http://www.python-blog.com/2010/02/09/sqlalchemy-model-generator-on-bitbucket/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 09:00:41 +0000</pubDate>
		<dc:creator>Marcin Kuźmiński</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[SqlAlchemy]]></category>
		<category><![CDATA[bitbucket]]></category>
		<category><![CDATA[model generator]]></category>

		<guid isPermaLink="false">http://www.python-blog.com/?p=244</guid>
		<description><![CDATA[I&#8217;m in a way of releasing few of my projects to bitbucket.
Starting now I&#8217;m releasing the Sqlalchemy model generator. A quick reminder, it&#8217;s a project that you
can generate models based on your database. So you don&#8217;t need to write models by yourself.
You can see the project here: http://bitbucket.org/marcinkuzminski/sqlalchemy_model_generator/
Any participants are welcomed.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in a way of releasing few of my projects to bitbucket.<br />
Starting now I&#8217;m releasing the Sqlalchemy model generator. A quick reminder, it&#8217;s a project that you<br />
can generate models based on your database. So you don&#8217;t need to write models by yourself.<br />
You can see the project here: http://bitbucket.org/marcinkuzminski/sqlalchemy_model_generator/<br />
Any participants are welcomed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.python-blog.com/2010/02/09/sqlalchemy-model-generator-on-bitbucket/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pylons translating custom error messages.</title>
		<link>http://www.python-blog.com/2010/02/08/pylons-translating-custom-error-messages/</link>
		<comments>http://www.python-blog.com/2010/02/08/pylons-translating-custom-error-messages/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:02:53 +0000</pubDate>
		<dc:creator>Marcin Kuźmiński</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[lazy translations]]></category>
		<category><![CDATA[orm]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[Pylons]]></category>
		<category><![CDATA[pylons translation issues]]></category>
		<category><![CDATA[python blog]]></category>
		<category><![CDATA[translation problems]]></category>

		<guid isPermaLink="false">http://www.python-blog.com/?p=148</guid>
		<description><![CDATA[I&#8217;d created another simple application in pylons, final step was to translate it from English to Polish.
I used the babel extractor recommended by pylons and that went really smooth.
My application have a language selector available anytime from menu.
I saw that even this switch worked very well for mako templates and string inside controllers,
 it did [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d created another simple application in pylons, final step was to translate it from English to Polish.</p>
<p>I used the babel extractor recommended by pylons and that went really smooth.</p>
<p>My application have a language selector available anytime from menu.<br />
I saw that even this switch worked very well for mako templates and string inside controllers,<br />
 it did not work when displaying my custom messages that i over rid in validators<br />
and also did not work in my own custom validators that inherit from FancyValidator.<br />
So i started to investigate this.</p>
<p>The first problem of not translating custom error messages in the regular formencode validators was easily being fixed by using lazy_ugettex method.</p>
<pre class="brush:python">
def _(s):
    #fix for translation error messages
    return lazy_ugettext(s)
</pre>
<p>This method allowed me to use lazy_ugettext to translate.<br />
So now when in the validators your translating a string using _(&#8216;this string is for translate&#8217;) method it&#8217;s actually wrapper for lazy_ugettext function.<br />
Lazy translation is when you translate a string when it is accessed, not when the _() or other functions are called.</p>
<p>The second problem of translating custom error messages in your own validator was a bigger problem</p>
<p>I was looking for a solution for some time, and found a nice trick. You have to use your own<br />
state_obj with static _() function. As example below for custom validation function.</p>
<pre class="brush:python">
class ValidLoginNames(formencode.validators.FancyValidator):

    messages = {'invalid_name':_('you cannot use %(username)s as login')}

    def validate_python(self, value, state):
        banned_names = ['admin', 'administrator', 'root']
        if value in banned_names:
            raise formencode.Invalid(self.message('invalid_name', state = State_obj, username = value), value, state)

#this is needed to translate the messages using _()
class State_obj(object):
    _ = staticmethod(_)
</pre>
<p>Those two trick now let&#8217;s you translate custom validators without a problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.python-blog.com/2010/02/08/pylons-translating-custom-error-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.184 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-09-03 22:56:35 -->
