Tuesday, December 18, 2007

Some updates

* My FOSS.IN/2007 talk about Zope went well, There was about 40
people for my talk.

* FOSS.IN/2007 was a great experience, even though there was no Python
talk, Python was everywhere. I heard people mentioning Python
during many talks. There was three Zope related talks. The
lightning talks timer program was created in Python, there was many
BangPypers wandering around the place. Unfortunately, we couldn't
arrange one BoF.

* ZCA book has a new French translation.
I also self published this book at Lulu.

* An interview with me and some other Python programmers.

Tuesday, November 27, 2007

FOSS.IN/2007 is coming up !

(This post's target audience are readers of Python, Zope & Plone

This year's FOSS.IN/2007 is coming up next month from December 4th to
8th at National Science Symposium Centre, Indian Institute of Science,
Bangalore, India. FOSS.IN is one of the world's largest FOSS events, held annually in India.
The event's main focus is on development and contributions to FOSS from India.
So, most of the talks are related to FOSS contributions. I also will be presenting a
talk about contributing to Zope project. Well, my original talk I submitted was
a general Python talk, which got rejected, so I also ended up with a
talk like this.

There is another talk related to Zope and Plone by Sreekanth S.R.

During the event, BangPypers will be conducting some BOF sessions. We
welcome all Python programmers to BangPypers BOF sessions.

Me & Nikhil N (last year GSoC student who worked on Python 2.5 porting
of Zope 3) planing to work on some Zope projects at hack center. Any
one intereted in Zope are welcome :)

BTW, this is for the first time I am going to meet Nikhil in person.
It was a nice exprience working with him during GSoC project. He is
also from my native place, Kerala. So, most of our discussions were in
our native language, Malayalam.

Saturday, November 24, 2007

Adapter pattern vs ZCA adapter

This is a section I added to ZCA book recently. I am not a pattern guru,
so please correct me if anthing is not correct or required more explanation.
Thanks !

Adapter pattern

The adapter concept in Zope Component Architecture and the classic
`adapter pattern` as described in Design Patterns book are very
similar. But the intent of ZCA adapter usage is more wider than the
`adapter pattern` itself. The intent of `adapter pattern` is to
convert the interface of a class into another interface clients
expect. This allows classes work together that couldn't otherwise
because of incompatible interfaces. But in the `motivation` section
of Design Patterns book, GoF says: "Often the adapter is responsible
for functionality the adapted class doesn't provide". ZCA adapter has
more focus on adding functionalities than creating a new interface for
an adapted object (adaptee). ZCA adapter lets adapter classes extend
functionality by adding methods. (It would be interesting to note
that `Adapter` was known as `Feature` in earlier stage of ZCA
design. ) [#feature]_

The above paragraph has a quote from Gang of Four book, it ends like
this: " ...adapted class doesn't provide". But in the next sentence I
used "adapted object" instead of "adapted class", because GoF
describes about two variants of adapters based on implementations.
The first one is called `class adapter` and the other one is called
`object adapter`. A class adapter uses multiple inheritance to adapt
one interface to another, on the other hand an object adapter relies
on object composition. ZCA adapter is following object adapter
pattern, which use delegation as a mechanism for composition. GoF's
second principle of object-oriented design goes like this: "Favor
object composition over class inheritance". For more details about
this subject please read Design Patterns book.

The major attraction of ZCA adapter are the explicit interface for
components and the component registry. ZCA adapter components are
registered in component registry and looked up by client objects using
interface and name when required.

.. [#feature] Thread discussing renaming of `Feature` to `Adapter`:

Wednesday, November 21, 2007

ZCA book translations - bzr - Launchpad - user group

Lorenzo Gil Sanchez (Gazpacho fame) is working on a Spanish
translation of ZCA book (PDF). It was a surprise for me to see a new bzr
branch at Launchpad for Spanish translation. Kent Tenney was also
excited, keep up the good work, Lorenzo ! I have published his
translation in my site (PDF). If anyone want to help him with
this translation or start a new translation to another language, you can
simply create bzr branch there and start working it.

Since I am involved in Zope 3, I become a heavy svn user. Now, after
I started using bzr for this project I realized the power of bzr (This
may be applicable to other DVCS). Currently we have three active
branches, the feature I like very much is merging from other branches
(Oh ! it's really cool). Thanks to Canonical for providing such a nice
hosting for bzr. After all Launchpad is a ZCA based application, then
how it won't be cool ? ;)

Since I published this work in last month, there was almost 5000 hits
for ZCA book. Also I got good comments and feedbacks in my journal
and through mail. It looks like people are also interested in
translating this work to other languages. To coordinate all these
efforts, I have created a google group. So, if you are interested to
help me in any way to finish this work, you can join me there.
Well, this is not a general discussion list for ZCA itself, you can
use zope3-users list for that.

Wednesday, November 14, 2007

ZCA book project at Launchpad

I got good comments for my last post about ZCA book (PDF).
Thanks to all those who commented in my journal.

Few days back, Kent Tenney suggested to host this project in a public repository,
so that, others can also contribute. Then, he himself setup a Lauchpad
project for the book
. Details about how to contribute is given in
the README.txt file there. I hope you will create a branch there :)

Kent Tenney also created a nice logo:

Wednesday, November 7, 2007

At last Zope 3 releases coming to an end !

Few days back Stephan Richter released Zope 3.4 second beta release.
The Zope 3.4 release may be the last release of Zope 3 release
as a single package. There is still a minor chance for a 3.5 release.
Anyway, Zope 3 as a single package is coming to an end. I won't be
surprised if the term "Zope 3" itself vanish in the future.

This is a good thing for the future of Zope project & community. As I
implied in one of my last post, Zope is becoming more "Pythonic".
Well, I am not going to describe "What is Pythonic" :) . You know,
Zope is even dropping the server business ! (Zope 3 used Twisted web
server as the default server for a long time). We also retired
zope3-dev list last month .

For those who using Zope 3.3 or earlier versions, Zope 3.4 is a chance
(may be last) for migrating to egg and buildout based system for
development and deployment.

Now you might wonder, "Where is Zope going ?" . This is a very
difficult question for me to answer, so, I refrain from trying it :)
Here I am just giving two pointers: Grok, Repoze.

However, I believe Zope 3 will live for a long time through the
numerous packages derived from it.

Update:I forgot another pointer: zopeproject

Thursday, November 1, 2007

Firefox bookmark for ZCA reference lookup !

Last week, Kent Tenney send me a cool Firefox trick for ZCA reference lookup.
His suggestions helped me to improve English style and usage in that book (Thanks Kent!).
With this cool trick you can go to a reference section just typing 'zca ' follwed by the word all in small letters.

I am quoting his message as such:

I just created a Firefox bookmark with the following properties:

Name: Zope Component Architecture
Location: http://www.muthukadan.net/docs/zca.html#%s
Keywork: zca

Now, when I type in the Firefox location bar:
zca getadapter

I'm taken to the reference for that method.


Kent, I reused this nice trick for another purpose also :)
To render reST page as HTML you can create a bookmark like this:

Name: reST to HTML
Location: http://api.rst2a.com/1.0/rst2/html?uri=%s&style=zope
Keywork: r2h

Thanks to rst2a.com team ! Now whenever I see a reST file online, I just prefix it with 'rst ',
this gives me a nice HTML page !

Text below is for my Kerala friends:

എല്ലാ കേരളീയര്‍ക്കും എന്റെ കേരളപ്പിറവി ആശംസകള്‍ !

Wednesday, October 31, 2007

Zope community, the largest producer of eggs !

If you check PyPI recent update any time, you can see at least one package
update from Zope community. Zope 3 itself has more than 140 eggs.
Zope 2 also started using eggs, I think Zope 2 itself is going be fully
eggified soon after 2.11 release.

It would be interesting to read Pradeep's post to BangPypers list along
with this. He says:

"The kind of functionality available in Zope and plone especially when
it comes to fine grained authentication, content metadata,
internationalisation support, are yet to be seen on other python
framework. However, the choice is simpler now, because Zope is pushing for a
``Python Ecosystem'' rather than a single do-it-all framework
. Once
again they lead the way."

Monday, October 22, 2007

Zope component architecture article -> book

Last Monday I posted about an article I am writing about Zope component
. This weekend I added a reference chapter. Now it has total 76 pages,
now it is more than the size of an article, so I would like to call it as a book :)
(I don't know the criteria for a book, may be I am wrong)

You can read the book here.

I didn't got any feedback for this work yet from Python/Zope/Plone community :( .
Though, I didn't lost my hope. I hope this time I will get some feedback :)

Update:I have added an HTML version of book (Thanks to Anonymous commenter).
Also I have uploaded the reST source.

Monday, October 15, 2007

Zope component architecture article

Few months back, I started writing an article about Zope component architecture.
But I couldn't finish it at that time. My friend Brad (thanks Brad!) reviewed the
initial draft at that time. Even now I didn't completed it as I wished, though,
last weekend I did some polish works. The last chapter is just a copy paste with
some minor changes from README.txt in source code of zope.component package.

Anyway, here is what I wrote so far. I am planning to look into
this article after some time (may be weeks/months). If you have any
comments/questions, please add it as a comment here.

Friday, October 12, 2007

Good bye zope3-dev list !

Zope 3 developers list is going back to where it is started.

The first mail to zope3-dev list was from Jim Fulton in 2001 and he
closed the list with a final thread. There was average 146 KB (gziped version)
mail per month for last 6 years and 500+ subscribers in zope3-dev list.

Recently Zope 3 has been "exploded" into individual projects.
The discussions about development of these projects will continue in
zope-dev list (The 'zope-dev' list is almost 9 years old now).

This is a good move, because Zope 3 is no more a single project. Zope
itself had more projects from the beginning. But projects like Zope 2
(Original Zope application + application server and/or framework),
ZODB (object database), CMF (content management framework) etc. was
more coarse grained. Then Zope3 also started like this, but it
consisted many re-usable packages. With the arrival Python eggs, it
become easy to manage small packages. Buildout pushed this trend
further. At last, this lead to splitting of packages into separate
projects, and we have a new term for that, "satellite projects". Also
these projects are more fine grained compared to Zope 2,ZODB etc. (I
heard Jim has plan to split ZODB into small individual packages in

The 'zope3-users' list will function as it is now. In future, this
list *may* also merge to general 'zope' list in favor.

Tuesday, September 25, 2007

Why Zope community use namespace packages ?

Zope project and the community in general use lots of namespaces
packages. Though, we have some non-namespace packages like
ZODB3,ZConfig etc. Zope community has created many namespaces
for packages like `zope`, `zope.app`, `zc`, `z3c`, `lovely` etc. Here
`zc` stands for Zope Corporation, `z3c` for Zope 3 Community and
lovely for Lovely Systems' packages.

Python is a language with namespace support at many levels.
Remember, the last line of Zen of Python reads like this: "Namespaces
are one honking great idea -- let's do more of those!"
Take it positively, don't interpret it more ;)

A namespace package will not have any method,class or any other
objects defined in that level. So a normal namespace package will be
only having an empty `__init__.py` file. Eggs and setuptools provides
some new advantages for the distribution of namespace packages. So,
normally a namespace package's `__init__.py` file will contain
something like this:

import pkg_resources

That's all you required to put in your namespace package's
`__init__.py` file. But you also will be required to add one more
keyword argument for `setup` function in your `setup.py` script like


You can even have nested namespace packages, in that case you have to
add it like this:

namespace_packages=['zope', 'zope.app'],

Remember, Zen of Python also says: "Flat is better than nested." .
Even though Zope use `zope.app` nested namespace package, Zope
community discourage nested namespace packages. The `zope.app`
namespace may be consider as a mistake of Zope project.

The `zope` and `zope.app` were the first namespace packages used by
Zope. I still remember the appraisal I got from Jim Fulton after
implementing his proposal for making `zope.app` a pure namespace

Here I will list some advantages of namespace packages. Feel free to
add/explain anything you found. :)

  1. Better grouping for projects/community/companies
  2. Better name for packages and don't worry about a name conflict
  3. Re-use package name in different namespaces
  4. Easy distribution as eggs

I think the last point requires bit explanation. Consider two
packages in same namespace, `zope.interface` and `zope.testbrowser`.
In Python, package name is tied to directory structure. So, in normal
distutils based distribution both `interface` and `testbrowser` should
be under `zope` directory. But setuptools and eggs allows you to
install both separately and still use both.

Let's save some names for new generation smart Python programmers !
Don't pollute top-level names, use namespace packages !!

Monday, September 17, 2007

zopeproject, a new way to getting started with Zope 3

Yesterday Philip announced zopeproject 0.4 . This is the easiest way to getting started with Zope 3. I have created a screencast here. I used virtualenv for installing zopeproject, and it was really cool.

Friday, September 14, 2007

BangPypers mailing list moved to python.org !

Today Anand B. Pillai (one of BangPypers list moderator and HarvestMan fame) with help from Jeff Rush moved BangPypers mailing list from Yahoo! groups to python.org. Thanks to Anand and Jeff Rush !

The initial motivation for this move was Brad Allen from Dallas Ft. Worth Pythoneers. He had a talk ("Python user groups unite!") at Bangalore Barcamp 4 in last july. He talked about Python advocacy and what Python user groups can do for this. He also gave lots of tips for running a successful user group from his experience at Dallas group. Thanks Brad for all this.

BTW, There is mailing list created for "Support and Mentoring of Usergroup Organizers (Current or Wannabe)". Also there is a Usergroup advocacy list.

Zope 3 for Djangoers

Today I found this blog in blogosphere : http://www.lorenzogil.com/blog/ ( I couldn't find name of blogger anywhere in that site)

The blogger has started writing some articles for Django programmers who want to use (or sitch to) Zope 3. So far there are three parts published . I think these articles will be useful for any Zope 3 programmers . Congratulations to the author !

BTW, In the first article the blogger mention that Python 2.5 cannot be used, but it's not true anymore. My student (Nikhil N from Kerala, India) has successfully ported Zope 3 to Python 2.5 as part of Google Summer of Code 2007. But Python 2.5 will not be officially supported until Zope 2 is also ported (This is a Zope Community policy, Yes ! we will not drop Zope 2 for anything, even for Python 3.x !!) . Zope Foundation had four GSoC projects and all of them are successfully completed. We will write more about this later.

Saturday, September 1, 2007

First python 3.0 try !

Congratulations to Guido and all other Python developers !

Today I came to office for some works, but when I looked at planet.python.org
I found many posts about Python 3.0 alpha1 release. Then I downloaded Python 3.0
from here: http://www.python.org/download/releases/3.0/

Here is my first "Hello World" program after compilation:

And here is the digg story (Digg it!): http://digg.com/programming/Python_3_0a1_Released

BTW, it would be really useful if "2to3" is available as egg.

Zope 3 has started discussing about Python 3 port, but it looks like no one is interested.

One of my favorite toolkit is PyGTK, and see they are really going to port it soon. But it will be only released after Python 3.0 final release.

Tuesday, August 7, 2007

BangPypers August meeting

There will be a meeting of BangPypers at ThoughtWorks office this weekend.
Venue and other details are here: http://wiki.python.org/moin/BangPypers
If you are interested, please add your name there.

Monday, May 21, 2007

A quick look at some package repositories

When I visited Python's cheese shop today, I stop for a moment at the total number of packages. This raised my curiosity to look at other languages' package repositories.

1. Perl (11643) http://cpan.org/
2. Python (2392) http://cheeseshop.python.org/pypi
3. Ruby (1587) http://raa.ruby-lang.org/
4. PHP (442) http://pear.php.net/packages.php

Well, I am not making any conclusion out of this, because there are many other factors required for an analysis.

Thursday, May 3, 2007

My $HOME/.buildout/default.cfg

Buildout is a tool which can used for any kind of applications, though
it is more suitable for Python based applications. href="http://cheeseshop.python.org/pypi/zc.buildout">Buildout is a
cool program which provides support for creating, assembling and
deploying applications, especially Python applications. You can build
applications using Buildout recipes. Recipes are Python programs
which follows a pattern to build various parts of an application. For
example, a recipe will install Python eggs and another one will
install test runner etc. Applications can be assembled from multiple
parts with different configurations. A part can be a Python egg or
any other program. Buildout make use Python eggs and so href="http://peak.telecommunity.com/DevCenter/setuptools">setuptools.
To install, Buildout just enter this command: easy_install zc.buildout
(Of course, you should have installed href="http://peak.telecommunity.com/DevCenter/EasyInstall">easy_install
to run this command)

I would like to share my default Buildout configuration
($HOME/.buildout/default.cfg) here:

newest = false
eggs-directory = /mbaiju/eggs
find-links = http://download.zope.org/distribution/

These options are available for all buildouts in my system. Sure, I
can override these options for individual buildouts. One of my
earlier post
had given hint for using simple buildouts. There, I used
"./bin/buildout -N" to run the buildout. See yourself what -N do from

$ buildout --help

Run in non-newest mode. This is equivalent to the assignment
buildout:newest=false. With this setting, buildout will not seek
new distributions if installed distributions satisfy it's

So adding "newest=false" option helps to avoid the "-N" switch.
IMO, this should be the default for buildout.

The "eggs-directory" option is really useful if you want to use
multiple buildouts from same machine, especially when developing
applications. If this option is not set each buildout will download
and store all egg dependencies in it's own folder, by default "./eggs"
directory in your buildout.

I set "find-links = http://download.zope.org/distribution/", because
my normal buildouts are Zope 3 related, and Zope 3 project place all
new eggs there. If this option is not set, buildout will fetch egg
Python's cheeseshop.

Tuesday, April 24, 2007

Projects using Zope Component Architecture

Dear lazyweb, I started collecting projects using Zope Component Architecture here:
So far I only found these projects:
1. Zope 3
2. Zope 2
3. Plone
4. Creative Commons Publisher (Desktop) : http://wiki.creativecommons.org/CcPublisher
5. Gaphor (Desktop UML Tool) http://gaphor.sourceforge.net/

If you know any other project, please add there :)

Thursday, April 12, 2007

Four GSoC projects for Zope Foundation

Zope Foundation has got four projects under Google Summer of Codeprogram. Congratulations to all students!

1. Run Zope 3 using Python 2.5
by Nikhil N, mentored by Baiju Muthukadan

2. Application for SoC: Zope Grok improvements
by Ulrich Fouquet, mentored by Philipp von Weitershausen

3. Zope3 Support for AJAX enhanced forms and widgets
by Paul Carduner, mentored by Martijn Pieters

4. Wandering Books in Grok (v.2)
by Luciano Gama de Sousa Ramalho, mentored by Martijn Faassen

Wednesday, April 4, 2007

Zope 3 applications from eggs and buildout

Here I will introduce two Zope 3 applications created solely
from eggs using Buildout.

First application will display 'Hello' when you access
http://localhost:8080/hello . You can checkout this from here:
svn://svn.zope.org/repos/main/Sandbox/baijum/z3hello/trunk .

Here is the steps to run the application:

  $ svn co svn://svn.zope.org/repos/main/Sandbox/baijum/z3hello/trunk z3hello
  $ cd z3hello
  $ python2.4 bootstrap.py
  $ ./bin/buildout -N
  $ ./bin/instance start

Now, from your browser go to : http://localhost:8080/hello

Running bootstrap.py will install setuptools and zc.buildout and it
will create a directory for building your the application. You can
run `bin/buildout` script created by bootstrap.py to build the
application. Then you are ready to start server using `bin/instance`
script created by buildout command.

You can try the ZWiki (Zope 3 version) similarly:

  $ svn co svn://svn.zope.org/repos/main/zwiki/branches/baijum-experimental-zwiki zwiki
  $ cd zwiki
  $ python2.4 bootstrap.py
  $ ./bin/buildout -N
  $ ./bin/instance start

To see Wikis in action, go into the management interface and add a
Wiki object named `mywiki`. Leave the two preselected options.

To access ZMI: http://localhost:8080/manage (username: admin,
password: admin)  Then visit: http://localhost:8080/++skin++wiki/mywiki

I know there are many "Why" questions. I suggest you to read about
Setuptools and Buildout for the answers. And if you know the
questions with answers, I welcome you to add it here as comments! :)

Friday, March 23, 2007

I am in three planets now!

My journal feed had already added to http://planet.python.org (also in
unofficial http://planetpython.org) long back.

Now I send request to Zope and Plone planets to add my feed. Thanks
to planet admins for adding me to their planets. For Zope and Plone
planets I have added my filtered feed which only contains topics
related to Zope 3 (sometimes Python also).

Well, I will introduce myself here. I am Baiju M, a relatively new
Zope 3 developer from Kerala [1] . Previously I have worked for Free
Software Foundation of India (as a Job) in 2002-2003. After that I
worked as a Koha [2] consultant for few months. Then I joined a
startup company based in Calicut (Kerala). I introduced them to
Python, we were mainly doing PyGTK [3] based enterprise applications.
Three months back I joined ZeOmega [4], a Zope based company.

[1] http://en.wikipedia.org/wiki/Kerala
[2] http://www.kohadocs.org/CDS_ISIS_to_Koha.html
[3] http://www.pygtk.org
[4] http://www.zeomega.com

Monday, March 19, 2007

Ugadi, Weekend, Office, Zope 3, Buildout

I thought just to write something now. Today is Ugadi [1], a few days back only I heard this word. This is a festival in Karnataka and some other parts of Deccan region of India. I am from Kerala [2], we have a similar festival coming up in next month called Vishu [3] . So happy Ugadi to all ! . Today is leave for my company [4], so we got 3 days consecutive leave. I could have gone to my home, but for some reason I postponed it to next week. One reason is that my wife's final year exam is starting today, so I though let she study :)

Remember my last post about Zope 3 [5], I wrote there that Zope 3 is evolving. Today morning I came to office to explore Zope 3 and Buildout. (I don't yet have a laptop, so office is the only place where I can do some coding) I am sitting alone in this big office now, oh! what a silence !! Today I manged to run a Zope 3 application solely from egg [6]

Oh! I cannot write anymore, I think I am feeling loneliness now. Hmm.. better to go to some park now [7]

[1] http://en.wikipedia.org/wiki/Ugadi
[2] http://en.wikipedia.org/wiki/Kerala
[3] http://en.wikipedia.org/wiki/Vishu
[4] http://www.zeomega.com/
[5] http://baijum81.livejournal.com/19086.html
[6] http://mail.zope.org/pipermail/zope3-dev/2007-March/022004.html
[7] http://en.wikipedia.org/wiki/Lal_Bagh

Tuesday, March 13, 2007

Zope 3 is evolving !

Zope 3.4 alpha 1 release is planned in first week of April, 2007 [1].
Zope 3.4 release will be based on eggs and buildouts. So you can use
the individual parts without using the whole Zope 3. Suppose you want
to use 'zope.interface', just 'easy_install zope.interface' will do it
for you. And if you want 'zope.component' [2], use 'easy_install
zope.component'. And there are many packages like this which does not
requires the whole Zope 3 (eg: zope.event, zope.deferredimport,
zope.testing, zope.testbrowser etc.). Most of them are available from
PyPI now !

And zc.buildout [3] is going to change how we develop and deploy Zope
3. If I want to modify (new feature/bug fix) zope.testbrowser I need
not to checkout the whole Zope 3 and start coding, rather I can
checkout zope.testbrowser and run 'buildout' command. It will setup
an environment where I can start working.

After 3.4 release, individual packages will be having it's own release

[1] http://wiki.zope.org/zope3/RoadMap
[2] http://wiki.zope.org/zope3/ZopeComponentArchitecture
[3] http://cheeseshop.python.org/pypi/zc.buildout/

Saturday, February 24, 2007


NIT Calicut [1] students organizing FOSS MEET @ NITC from March 2nd to
4th [2]. I am looking forward to my talk about Zope component
architecture during the event. I am an alumni of this college. So, I
am really happy to go back to my college. Few days back I started
working on my slides and few other materials [3].

[1] http://nitc.ac.in
[2] http://www.foss.nitc.ac.in
[3] http://zissue.berlios.de/z3/zca.tar.bz2

Sunday, January 7, 2007

Zope 3, Bangalore, ZeOmega, Bangpypers

This is my first blog entry in this year, so, Happy new Year!. I implemented one proposal by Jim Fulton and committed to trunk two weeks back [1]. I moved to bangalore on 1st january as part of my new job at ZeOmega [2]. Then... well, today evening I attended BangPypers meet [3].

Now I am in an internet browsing center near BDA Complex at Banasankari 2nd Stage in Bangalore. This is for the first time I am coming to Bangalore. I want to write more about this place and life. OK, will do it later.

[1] http://wiki.zope.org/zope3/LoadingConfigurationFromTheZopeAppEgg
[2] http://www.zeomega.com
[3] http://bangpypers.org/