<?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 &#187; Python</title>
	<atom:link href="http://www.python-blog.com/category/python/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>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>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>
		<item>
		<title>Mail problems&#8230;</title>
		<link>http://www.python-blog.com/2010/02/07/mail-problems/</link>
		<comments>http://www.python-blog.com/2010/02/07/mail-problems/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 21:21:23 +0000</pubDate>
		<dc:creator>Marcin Kuźmiński</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.python-blog.com/?p=242</guid>
		<description><![CDATA[So again the blog was having some mail problems which I just fixed.
So anyone can register, post to the blog again.
Sorry for the problems.
]]></description>
			<content:encoded><![CDATA[<p>So again the blog was having some mail problems which I just fixed.<br />
So anyone can register, post to the blog again.</p>
<p>Sorry for the problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.python-blog.com/2010/02/07/mail-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stackless python and python C Extensions</title>
		<link>http://www.python-blog.com/2010/02/07/stackless-python-and-python-c-extensions/</link>
		<comments>http://www.python-blog.com/2010/02/07/stackless-python-and-python-c-extensions/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 19:34:36 +0000</pubDate>
		<dc:creator>Marcin Kuźmiński</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[montreal python]]></category>
		<category><![CDATA[stackless python]]></category>
		<category><![CDATA[videos]]></category>

		<guid isPermaLink="false">http://www.python-blog.com/?p=235</guid>
		<description><![CDATA[I was browsing a web for some videos about stackless python implementation.
And i found a Montreal Python blip tv channel. montreal python blip tv
They have few interesting podcast which i recommend everyone to watch. The two last ones,
are dedicated to Stackless python and C extensions. Those are montreal python #8 and #9.
Be sure to check [...]]]></description>
			<content:encoded><![CDATA[<p>I was browsing a web for some videos about stackless python implementation.<br />
And i found a Montreal Python blip tv channel. <a href="http://montrealpython.blip.tv/">montreal python blip tv</a><br />
They have few interesting podcast which i recommend everyone to watch. The two last ones,<br />
are dedicated to Stackless python and C extensions. Those are montreal python #8 and #9.</p>
<p>Be sure to check them out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.python-blog.com/2010/02/07/stackless-python-and-python-c-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Efficient reading a huge file in python</title>
		<link>http://www.python-blog.com/2010/01/02/efficient-reading-a-huge-file-in-python/</link>
		<comments>http://www.python-blog.com/2010/01/02/efficient-reading-a-huge-file-in-python/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 11:36:23 +0000</pubDate>
		<dc:creator>Marcin Kuźmiński</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.python-blog.com/?p=225</guid>
		<description><![CDATA[Reading a huge file (ie. 70gb) in python just using open() could get you in troubles :).
There is a clean and nice solution for reading a complex huge files or list.
Using the new with open() as  statement and python generator function you could write an easy functions
which will read such files without taking whole [...]]]></description>
			<content:encoded><![CDATA[<p>Reading a huge file (ie. 70gb) in python just using open() could get you in troubles :).<br />
There is a clean and nice solution for reading a complex huge files or list.<br />
Using the new with open() as  statement and python generator function you could write an easy functions<br />
which will read such files without taking whole computer resources. Each iteration on such a function will perform a read of<br />
given size, and the with statement will make sure that file is closed when iteration is finished&#8230;</p>
<p>An example of such a function:</p>
<pre class="brush:python">
def read_large_file(filename, mode = 'rs', size = '1024'):
    '''
    A lazy generator functions that reads a file with a given chunk of data
    USAGE:
    for data_chunk in read_large_file('/tmp/huge.file','rb',10240):
        print data_chunk
    @param filename: a filename
    @param mode: read mode
    @param size: size to read at one iteration
    '''
    with open(filename, mode) as f:
        while 1:
            data = f.read(size)
            if not data:
                break
            yield data
</pre>
<p>Remember that with statement is supported out of the box from python 2.6 in python<br />
2.5 you have to do</p>
<pre class="brush:python">
from __future__ import with_statement
</pre>
<p>before using it. If you have troubles using with statement i recommend reading<br />
<a href="http://effbot.org/zone/python-with-statement.htm">this link</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.python-blog.com/2010/01/02/efficient-reading-a-huge-file-in-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
