Personal tools
You are here: Home Weblog Archive 2008 March

Entries For: March 2008

2008-03-28

Ubuntu Hardy Heron: some things are bad

Filed Under:

Note to self: always create a root account on Ubuntu.

I've updated my laptop to Kubuntu Hardy Heron, and while some things worked fine, there are a couple of stupid bugs that chained to make my life hard.

First of all, why did the Network Configuration applet in Settings Manager in KDE saw fit to delete the hostname of my localhost, tibi-laptop, from /etc/hosts? Now I can't run anything with sudo, as it imediately aborts with an error "No hostname tibi-laptop". Why can't my laptop find any Access Point if there wasn't one accessible at boot time? Why, when I've started Ubuntu in single mode, was I greeted with a dialog that asked me to select an option (continue normally, drop in root shell, fix X) but which didn't allow me to select anything (the keyboard wasn't properly recognized, even though that I have a perfectly regular keyboard on my laptop). Why does the reboot never finishes and maxes out the CPU?

The only way I could fix the hosts problem, while avoiding to hunt for some Linux cd, was to boot in Windows and install Ext2fsd and after that I was able to mount and change the /etc/hosts file.

These things are basic, they should just work. I'm aware that Hardy is beta right now and I'm using the KDE part of Hardy, but with Gutsy, (even though that applet always screwed up my network settings), I never had these problems. Shouldn't things go forward instead of backwards?

2008-03-19

Why do I use Zope 3?

Filed Under:

I'm in the process of beginning a new project and I'm debating on what framework to use. Of course it will be Zope 3, but why do I use it. Well, it's sure something that has to do with these facts:

  • it's open source, with a strong, mature community around it
  • while it's still actively development, it has a stable API
  • it's written in Python, one of the easiest and most powerful languages
  • it's built around a component architecture, which means writing pluggable applications comes naturally
  • solves the problem of publishing objects through the web
  • everything is transaction based. You won't lose data with it, you won't get garbage data inside your database
  • it has fast, configurable storages (ZODB, Relstorage)
  • internationalization and localization is easy
  • it's a library as much as it is an application server. When it's a library, it's very slim and as a full application server has a lot going on, including XMLRPC, ftp, webdav, sql connectivity, its own http server, etc.
  • has a cool, extensible templating language (the Zope Page Templates)
  • makes it extremely easy to create and store objects through ZODB
  • has facilities to query for objects using indexed data, through zope.catalog and extensions
  • writing a new catalog index is not an extremely complex task
  • it has an event framework; no complex application should run without an event framework
  • has advanced, flexible form libraries that can generate forms introspected from the models (zope.formlib, z3c.form)
  • has advanced templating concepts and content placement, such as the pagelets and viewlets
  • it's "enterprise ready": it's possible to load balance zope clients using ZEO or relstorage
  • comes with extensible authentication and user sources
  • promotes an extensible build system for applications (zc.buildout)
  • follows python standards, for the most part: library packaged as independent eggs and while it's not built around WSGI, it has full support for it
  • it can do document workflows (hurry.workflow)
  • it has some very cool packages from the community:
    • zc.table
    • z3c.form
    • Storm and sqlalchemy wrappers
    • zc.resourcelibrary, z3c.resourceinclude
    • z3c.pagelet
    • lovely.remotetask
    • grok
    • gocept.registration
    • z3c.traverser
  • is very well documented
  • it fits comfortably in my brain


2008-03-18

A few ATReferenceBrowserWidget tips

Filed Under:

On a Plone 2.5 project I'm working I have a content type that has 3 reference association to another content type. ArchGenXML generated the fields with the same name, which means that in the interface there will be just one field, as they overwrite each other. To have them working I need to rename them, but how to do this from the model? Agx, at first glance, doesn't have support for this. While playing and even trying to change agx to support this use case, I've noticed that agx considers the "association end" as the one meaningful: all tagged values set to it are reflected in the generated case. So the solution to this problem is to set a "name" tagged value in the "end" of the direct associations relationships. Check the following screenshot from Poseidon to see what I mean:

 

Field name in association

 

Another issue, this time directly related to the ATReferenceBrowserIssue, is the startup directory support. The widget has support for defaults set in portal_properties/site_properties, a property called refwidget_startupdirectories. The wording of this property's description in the README left me, as a non-native English speaker, a bit clueless. After some digging and debugging, I found out that the format for the lines there is:

/pathA:/pathB

where pathA is a path relative to the Plone site root; when you call the reference browser widget for an object in this path, the second path, pathB is returned as a base for browsing for objects. Even after I have understood the thing about the two colon separated path, it didn't work for me because I was refering to paths with their absolute paths (based in the Zope root) instead of their paths relative to the Plone site.

 

2008-03-17

GHOP Plone skins overview

Filed Under:

Plone has very few skins available from the community, when compared to just about anything. The skin incompatibilities that appeared between Plone versions 2.0/2.1/3.0 further deepen this problem. As a result of the 2007 Plone - GHOP there are some skins placed in the collective, but they're not visible anywhere (they're not published in the PSC, only some of them are available as eggs in PyPI, to get a glimpse of them you need to install them). These skins are placed under the plonetheme namespace, along with other skins, unrelated to GHOP.

To make them a bit more visible (and to serve as a personal reminder for their design), I'm showcasing them here. In reviewing them I've used Plone 3.1 (the trunk of the ploneout package).  After each skin was installed and snapshotted, I've uninstalled it and installed the next one.

Click on each thumbnail to get to the full image.

Andreas 01

Andreas01 - anonymous view  Andreas01 - editor view

One of the nicer skin, it stands out through its center align design, different sized columns and its simplicity. I can see myself using this skin as a base for a skin customization.

BlueBlog


BlueBlog - anonymous  BlueBlog - editor

This skin, as its name implies, is better suited for a blog, through its tall, thin design. Not a programmers blog though, and that's too bad, as it's a good skin.

Essay


Essay - anonymous  Essay - editor

Nice skin, I especially like the portlet design. Somewhat simple, though. If I'd customize this skin, I'd make it wider (maybe make it whole page instead of center-centred)

Green Community


GreenCommunity - anonymous  GreenCommunity - editor

A non-conformist skin, but still good looking. From what I have seen watching the PyPI, it's still under active development. There are some problems with it, though: the login portlet at the top is not fully visible, the "editor" version is missing some bits of the full skin. Still, it could be used for blog-ish type of sites, after some customizations.

Grok

Grok - anonymous  Grok - editor

This skin is very similar (might be the same) to the one used for the Grok project website. Probably not a GHOP skin. Although it seems like a very simple customization of default Plone, there are many issues with it that would mean that it would require heavy work to make it publishable for a real website.

Napoli

This is an almost empty skin, no point in showing it here

Pizza


Pizza - anonymous  Pizza - editor

Not a GHOP skin, this skin was created in a sprint. I believe its aim is to be one of the official supported skin. It is somewhat similar to NuPlone. Still needs work, though.

Plone2Kiss

Another empty skin

Python

Python - anonymous  Python - editor

Very similar to the current python.org skin. It feels rough and unfinished, but otherwise a nice, clean skin.

Relic

Relic - anonymous  Relic - editor

Ugly, amateurish skin. Needs a lot of work to get it into something usable. Probably you're better looking for something else.

Sonia

Sonia - anonymous  Sonia - editor

Not a GHOP, it just sits in the Collective svn repository. Promising, but would need a lot of customizations to make it work.

Conclusion: the problem remains: there are very few community-produced plone skins, and the ones available are usually low quality. We, the community, have got to do something about this.

Note: I have no affiliation to any of the GHOP students, mentors or the Plone - GHOP project.

2008-03-13

Tutorial: run ArchGenXML 2.0 under virtualenv

Filed Under:

The "modern" (post 1.5) version of ArchGenXML is packaged as egg, available on pypi. While in theory you could run "sudo easy_install archgenxml" and have it running with minimal effort, because it depends on zope.component and zope.configuration, things tend to get muddy and complicated. If you'll "easy_install zope.component" you'll get a bunch of zope eggs installed in python's site-packages and this will probably cause problems. When I've started developing with Zope 3 I had some hard time tracking some problems that ultimately turned out to be caused by zope packages installed in the system python "conflicting" with my regular zope instances. Even the Plone installer prefers to create its own Python directory, to keep the its packages separated from other python packages installed in the system. To solve this problem, ArchGenXML has a mechanism to specify a path to the zope packages, of which I've already blogged about, but I now consider it an extra step which can be avoided by using virtualenv to install the archgenxml egg.

This following recipe is specific to Ubuntu, but probably adaptable to any Linux system, and even Windows. First, if you don't have easy_install in your system, install it with:

#sudo apt-get install python-setuptools
#easy_install virtualenv

In my ~/Software folder I've ran:

#virtualenv agx

This will create a ~/Software/agx virtual environment. We need to activate it:

#source agx/bin/activate

Now all python commands we will run (python, easy_install) will 'belong' to this virtual environment. We can safely install agx, zope.component and zope.configuration, as they will be installed there:

(agx)#easy_install archgenxml
(agx)#easy_install zope.component
(agx)#easy_install zope.configuration

The ArchGenXML egg has defined several console scripts, they're available as scripts "tied" to this virtual python environment, for example, this is the 'archgenxml' script that was installed in my ~/Software/agx/bin folder:

#!/home/tibi/tmp/arch/bin/python2.4
# EASY-INSTALL-ENTRY-SCRIPT: 'archgenxml==2.0-rc1','console_scripts','archgenxml'
__requires__ = 'archgenxml==2.0-rc1'
import sys
from pkg_resources import load_entry_point

sys.exit(
load_entry_point('archgenxml==2.0-rc1', 'console_scripts', 'archgenxml')()
)

What this tells us is that you can safely run this script from "outside" the virtual environment, without needing to first "source bin/activate" it.

Weblog
Atom
RDF
RSS 2.0
Powered by Quills
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: