Archive for March, 2009

Eclipse bundle: build your own

Posted in eclipse on March 18, 2009 by toutpt

Remember an old post i have done about the way i manage eclipse third part plugins dependencies, i have discover a web site where you can select the plugins you want and it build a bundle for you ready to be downloaded:

Yoxos eclipse service

I have tried it and it rocks ! For 131 MO to download i got:

  • Pydev
  • WTP (XML + JS + …)
  • Git plugin
  • Mylyn + Mylyn connectors for Track and Mantis
  • AnyEdit (manage tabs and spaces)

And you don’t have all Java’s stuff in your eclipse so it’s stay clean and start quickly.


Plone and local roles, too quiet.

Posted in plone on March 14, 2009 by toutpt

I have work hard on testing/debugging an already developed specific app that handle local roles in a Plone site. I was sure that local roles was just manageable throw a permission but i have finally read the code that handle local roles and understand things:

* you can only add a role to somebody if you have the permission “Change local roles”
* you can only add a role to somebody if you this role in that context
* role are quiet on error (if you don’t have the role you are trying to add, you will not have any log)
* if you have manager role you can do what ever you want (don’t do your tests in manager !!! )
* else candidate local roles are only yours without ‘Anonymous’, ‘Authenticated’ and ‘Shared’
* local roles are stored in a dict called __ac_local_roles__ on the context

After one day of work with local roles, i think the most painful part is to don’t have log, even in debug mode. When a process is called to do a job and it do half of it, i think it has to said something.

But local roles are an essential part of Plone that i really like.

PS: i have discover to late a good module to display local roles in Plone: zopyx.plone.cassandra.

i m switching from SVN to GIT

Posted in git, tools with tags on March 7, 2009 by toutpt

yet an other post to say svn sucks. yes it is. But many people who use svn are happy with it and i was happy to.

It’s hard to maintain a trunk when 5 people are commiting on it during the project life. So i have started to look at DVCS (git hg, bzr). I have tryied GIT because of it’s popularity.

At work, someone is using mercurial (hg) and we are two people intersting in GIT. So i have decided to test it but over SVN. it means the central repository is still an svn one.

Here is the way i m using it:
1. clone the repo (git svn clone blabla)
2. branche
3. work on your code (commit, …)
4. merge on master
5. git svn dcommit

And you get it, only one commit on the trunk (master) and the power of git to merge, commit, …

Some cool features and properties of git:

  • space on hdd of a git clone < svn checkout (and you get the all history
  • fast, git is damn faster than svn. When you type enter key, you get it (except from git svn clone, because here it’s svn)
  • qgit2 (qt4) is a very good tool (you can browse your svn history, look at diffs, ….)
  • the help on command line. git status give you help for next command you will make

But there are some point i have not found handy:

  • git st mygitrepo/ doesn’t work (“is not a git repo” but it is)
  • no default alias (st, co, …) but can be easily configured
  • svn externals can be seen has submodules, but no managed in that way. git svn do not handle svn:externals and you can’t use git submodules over svn
  • eclipse do not manage git (and i know it s a pain for eclipse guys because it break the way plateform is thought)

I hope all that things will be improved in the futur of git, but now i m using git at work. Next step will be code review TTW.

build a zope 3.4 with Postgresql and YUI framework & get ready to work with

Posted in python, zope on March 3, 2009 by toutpt

I just want to try to make a simple application with the best of current opensource technologies. Got a try with those one:

  • Python 2.5
  • Zope 3.4
  • Postgresql 8.3
  • SqlAlchemy 0.5
  • YUI 2.7
  • ZODB in Postgresql with RelStorage

I have take an hour to install this on my laptop, with the excellent virtualenv to build a copy of an already installed python in a directory.

/path/2/python/bin/virtualenv --no-site-packages /path/2/project

Next i have use zopeproject to install the last zope3 technologies. Now zopeproject use the KGS to set the version of eggs to use.

cd  /path/2/project
source bin/activate
easy_install zopeproject
zopeproject myproject

You get it, you have the last release of zope3.4 release. Now add the eggs you want to use

eggs = ...
#       chameleon.zpt require zope.i18n > 3.4

modify your zope.conf to configure RelStorage:

%import relstorage
      # The dsn is optional, as are each of the parameters in the dsn.
      dsn dbname='zope' user='zope' host='localhost'

Now, you get your zope3.4 running on python2.5 and store the zodb data in postgresql. I have lost most of the time on RelStorage and postgresql configuration. I’m to work with all those technologies.

I will work on making a simple blog in pure zope3, and next i will try to make the same application with SqlAlchemy.