Archive for the ‘zope’ Category

buildout.el, Emacs bliss for buildouts

Emacs can be a nice OS for doing Python development with. You can use the built-in eshell to execute your code, start your server and run your tests. It is even nicer to use things like gud, compile mode and tags. If you are working on multiple projects (like I am) over the course of a day it can be a bit to much to M-x pdb <enter full path to bin/instance> every time.

This is where buildout.el comes in. It has a few interactive functions (which you should bind to a shortcut, like the F1-12 keys) to execute these things. It knows where you are by checking the location of the current buffer and then crawls up until it finds something which looks like a buildout directory.

These are the features it currently provides:

  • Buildout invocation (with bootstrap if necessary)
  • Creation of a tags file (using etags)
  • Running the tests in compile mode (colors + jump to the line which triggered the failure)
  • Start your app server (bin/instance or bin/django) in a gud session

If you have any suggestions for improvements please let me know so we can make it even better. The only thing left to do is to download buildout.el, just add something like (load-library “buildout”)
to your .emacs and add keybindings. These are mine:

;; Key bindings
(global-set-key ‘[f5] ‘run-application-based-on-buffer)
(global-set-key ‘[f9] ‘run-buildout-based-on-buffer)
(global-set-key ‘[f8] ‘run-etags-based-on-buffer)
(global-set-key ‘[f12] ‘run-tests-based-on-buffer)

Advertisements

Completing the plugin – integrating it with Zope

The next tutorial on KSS is up. This time you will learn how to complete the plugin by writing the server side components. In the end you will have a working plugin which you can call from the server just like any other KSS command.

PUN meeting at a farm

The trip to the meeting was almost surreal. Instead of driving there it felt like a trip trough the heavens.  Outside pieces of clouds flew by whilst inside the car music set the mood.

Unlike previous meetings this one was held in farm near Utrecht. I was driving there from work with Jan (a collegue of mine). He drove ahead and I followed behind him. Because of the dense mist we couldn’t see more than a few meters ahead. After a few detours we made it to the meeting location.

Stani and his girlfriend really put in a lot of effort to make people feel at home. They even had food prepared to nourish the hungry.

The meeting was well attended and after a while a large group (around thirty people) gathered for the first talk. Martijn Faassen introduced us to Grok. This little cave man seems to introduce a new flavour to Zope 3 development. And from what I have seen it might be the yummiest to date.  I think Grok is best explained in an analogy to Apple. You see, Grok is to Zope 3 what the Mac is to Unix. Just like the OS X you get a nice interface (no more ZCML and other low level plumbing). But the best is that it still allows you to code against the low-level framework whenever needed.

Grok is a huge step forward and one that will attract a lot of new people to Zope.  Just like Apple made Unix accessible for the masses this system enables people from all scripting or programming backgrounds to quickly become productive with Zope.

After a short break we continued with a talk on test driven development. Doing such a talk always gets some crowd participation (sollicited or not) on which framework to use etc. I think Frank Niessink did a good job of explaining the underlying principles. It was also nice to hear his experience and point of view.

In line with Frank’s talk the next presentation was on AOP with a focus on (unit)testing. Remco Wendt told us his experience with testing complex systems. He showed how to use AOP to write tests against a remote service by replacing the implementation run-time. It won’t replace my stubbing/mocking habits but its always nice to rethink your choices.

To wrap the evening up Stani gave a presentation on the Copacabana Cybercafé project. This is one of the things I like best about being in the Python community. Although it may seem (at least to me) that everyone is developing web apps this is certainly not the case. Stani used Python in this case to create a cyber cafe in which reality is subtly though drastically changed. Basically he wrote a proxy which substitutes words on a web page with different words. An example of this is changing terrorist for martyr. He also showed us some more examples.

It was a great evening and I want to thank everyone involved for making it happen. Etienne was definitely right that to much time had gone by without a meeting.