Creating arbitrary objects in the current module namespace

This short recipe will show how to create arbitrary named objects in the current module namespace. Either globals() or locals() can be used for the task, depending on the namespace where the variables have to be created (global or local). >>> for i in range(10): >>> globals()['test%s' % i] = i >>> print test0 0 >>> print test1 1 [...]

Short intro to ZEO

Joel Burton is holding ad-hoc tutorials on IRC :-) Anyway, here's his recipe to running ZEO <joelburton> having your site running under zeo also allows you to "zopectl debug" it while it's still running, which is insanely useful. i _always_ run zope under zeo, even during development, even on my laptop, etc., and i recommend that to others. <joelburton> thegoldenaura: zeo just splits zope-the-app-server and zope-the-database into two <joelburton> the goldenaura: for small sites, where you expect to have just one zope server for your zeo server, i do it like this: [...]

Small tip when using wxWidgets

Always put your controls in a sizer inside a panel. So, the actual tree would be frame > sizer > panel > sizer > ... controls The reason is that the panel component will enable tab traversal. Also, the panel can so be used to group the widgets into logical groups, to facilitate traversing them with the tab key. Oh, did I mention wxGlade (from cvs) rules? [...]

Miniguide to openldap

LDAP is a lot easier then one might think at first sight. First, reading this short introduction to LDAP will tell us that LDAP is just an object database, that holds trees of objects and schemas of those objects. This is nice and easy for anyone acustomed to ZODB and Archetypes. Next, installing. The OpenLDAP server on Debian is called slapd, so apt-get install slapd. After that, run dpkg-reconfigure -plow slapd which will allow reconfiguring the domains. [...]

Tricks of the mind

I've been playing in my mind, for the last two days, for no apparent reason, "Birds of a feather" by Phish. I even asked myself at one point what's with the song that keeps appearing in my mind. Well, I think I found the reason. For the last two days, the first portlet on my customized slashdot homepage was KDENews, which had a news item on a "Birds of a Feather" [...]

Overriding the form controler script for AT content

Just like the edit form or the view page can be overriden for an AT type, so can the form controler script that would be called by the form. This recipe is lifted from SignupSheet (which I think got an inspiration from POI): The form controler script (mytype_post.cpy): ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind state=state ##bind subpath=traverse_subpath ##parameters= ##title=Do something ## #do something here, like for example, changing the workflow status of the object [...]

Cool use of Z3 tech in a Plone product

Easycommenting is a product that enables commenting on any content item. Rather dull, but the technology used to create it is very interesting. The skeleton is generated with ArchGenXML, but the content is zope 3 aware and can be adapted to use by any other object. My main interest is to regard it as a documentation, as its implementation is clean and covers several areas of functionality that I'm very interested these days (z3 content in plone, adaptors, views, etc). [...]

I don't like the new python.org webpage

When it first appeared, I said "heh", but now I don't like the new python.org webpage. The new page certainly looks a lot more 'designed', but the old one was certainly cute, and had the classic python logo. Where's that lovely snake? My concern is the overall feel of the page, not its content or internal organization. The present colors are too "4 years ago", I especially hate that blueish color. [...]

Games for Linux

Following link from the PyPi, I've stumbled upon this page: http://emhsoft.net/index.html The abstract shooters on that page are very nice. Also, a few of those games are implemented with pygame ;-) . [...]

Accessing a zope object stripped of acquisition

To get an object completely stripped of its acquisition layers, the following snippet can be employed import Acquisition obj_no_aq = Acquisition.aq_base(obj) No acquisition means no methods or properties inherited from the container or the container chain. Although a bit old, the Zope Developer Guide, with its chapter on Acquisition do a fine job at explaining the intricacies of acquisition in Zope 2. [...]