Entries in the Category “english”

zinebuildout 0.5 : a buildout for Zine

written by ccomb, on Jul 19, 2009 11:26:00 PM.

Zine logo

This blog is powered by Zine, a blog engine written in Python (with Werkzeug, Jinja2 and SQLAlchemy) and I'm very satisfied with it. I first want to thank its main author, Armin Ronacher (mitsuhiko) and the contributors. It's development is not as fast as I initially expected, but it's mercurial repository shows a constant activity:

Zine activity

Yes I know, I should contribute... Until now, I did not find any time to do it, but this could change in a near future.

When I first installed it, I was surprised there is no distutils/setuptools setup.py file, just a classic 'configure && make' procedure. The authors probably want to avoid any Python-specific tasks during installation, so that it is more widely adopted. They also probably don't like setuptools (BTW, setuptools is being forked for real by Tarek). The same applies to the deployment: Zine is expected to be deployed with mod_wsgi, which promises to offer easy and shared Python hosting to the masses.

But I'm used to Python tools, I don't find that typing "sudo python setup.py install" or something similar is difficult, I like to deploy with PasteDeploy, and I like to work with Buildout. That's why I've packaged Zine in a setuptools-enabled buildout.

Below is the content of the README file for version 0.5 of the buildout. I've also added a Twitter widget, but this one should better go in Zine itself, or in an external plugin. You can see the result right here, on the right.

http://pypi.python.org/pypi/zinebuildout/

Installation

This package allows you to install Zine and its dependencies in a sandbox with buildout, then serve it with any WSGI server while using the Paste facilities for WSGI stack configuration.

Install Zine:

Download and extract the zinebuildout archive from PyPI, (or clone it with: hg clone https://cody.gorfou.fr/hg/zinebuildout ). You don't need to easy_install it. Then run:

$ python bootstrap.py
$ ./bin/buildout

Configure Zine:

Edit "deploy.ini" to adapt instance_folder, host and port to your needs. You don't need to change anything if you just want to try it on your local host.

Start Zine:

In foreground:

$ ./bin/paster serve deploy.ini

Or in background:

$ ./bin/paster serve --daemon deploy.ini

Optional Twitter widget

This distribution offers a Twitter widget that displays the N latests tweets of your timeline. To use it, just add the following line in the '_widgets.html' file of your Zine theme:

{{ widgets.tweets('ccomb', 5) }}

Replace 'ccomb' with your twitter account, and 5 with the number of tweets you want to display.

Doing music with a stepper motor and... Python

written by ccomb, on Feb 6, 2009 5:02:00 PM.

relief.fr

Relief.fr is an agency specialized in 3D stereographic technologies (what we call "relief" in french), located in Paris. It's a great team, they have a long-standing know-how with stereography, anaglyphs, 3D projection, and they also really master the production of images dedicated to the innovative 3D LCD panels from Alioscopy.

/static/Alioscopy40.jpg

Stereoscopy normally needs making 2 images: one for the left eye, one for the right eye. Producing images for these 3D screen is much harder because they require shooting 8 images. Seeing such a screen for the first time is really astonishing, because you not only see in 3D without 3D glasses, but you can also turn around the object on the screen! Not a lot, but you can. Just put a screen on your stand in an exhibition, and you are guaranteed to see everybody stopping in front of you. I'll try to bring one at Solution Linux 2009 for the AFPY stand.

To be able to shoot 8 images, we need to move a camera on an aluminium rail very quickly, while the camera is in burst mode. Everything is home made. The rail and the power supply is manufactured by a motion control specialist, while I'm programming the movements of the stepper motor in Python, with an USB controller, an eee-pc, and everything on Linux.

Since I'm also a musician, I really like to do music with everything: that's really easy with a stepper motor: you just give him a frequency to make it move, and a frequency is just a note. Starting with the 440Hz A, you just have to multiply by the twelfth root of two ( 2^(1/12) ) to get the next semitone. Then you can play music :)

This is very noisy because the rail is on a wood box. The high notes are not exactly right, because of some harmonics, and also the rounding of frequencies to the nearest integer.


test