Archive for the 'XMPP' Category

1st notification

(This post was migrated from my previous blog. Originally published: 2007-06-01 21:39:44)

It’s time for a quick update on my Summer of Code project progress. Four days have passed since the official start of coding, on May 28th, and yesterday the simplest usage scenario actually worked. Notification, that is:

notify1.png

On the screenshot above you can see a message from my notification bot, sent when a page I’m subscribed to was changed. The message is exactly the same for both email and Jabber notification, so i18n Just Worked™ without any additional changes. The code to make it happen was (and still is!) crude, with some hardcoded values here and there, but I feel it’s a good base for further development.

MoinMoin (note the new, funny domain) used to have no event system. Notifications of page changes used to be sent via email from within the PageEditor class itself, on page save. I’ve created a simple, plugin-based eventing “framework”, using the Observer pattern, and moved the notification code there. Then, using standard Python’s xmlrpclib module, added a tiny bit of code, that communicates with the notification (Jabber) bot.

The bot itself consists of three components, running in separate threads, which communicate through shared Queue objects. One of them is responsible for receiving and handling XML RPC requests, second one does all the work related to Jabber/XMPP communication, and third one will, in the near future, perform editing actions on wiki.

Back to coding…

Obligatory progress report

(This post was migrated from my previous blog. Originally published: 2007-06-18 18:29:09)

It’s time for my Summer of Code progress report, as we’ve just finished the 3rd week of coding. Incoming exams are slowing me down slightly, but otherwise everything is going well.

The current state of the event system I’ve introduced is there to stay. Notifications are being sent when pages are being created, deleted and edited, when someone adds a new attachment, creates an account or changes his/her JID in preferences. In addition, users can set which events they’re interesting in being notified about. Some of these are available to Super Users only, of course. The notification bot reacts accordingly, by managing its subscription list properly. On the bot side, I’ve implemented a few commands, mapping directly to Wiki RPC 2 API functions, notably GetPage, GetPageHTML, GetPageInfo and GetPageList. User interface is rather simple so far, as it utilizes only plain-text functionality of base the XMPP specification, but more advanced options using Out of Band Data and Data Forms are going to be implemented mid-summer. There are even some basic docs! :D

The following days will bring even more improvements – extended command list, more internal events and, I promise myself, unit tests, using the py.test toolkit.

There are also good news for those interested in trying these new features out: there have already been early merges of my development branch to the main 1.7 one, so people interested in new features (notification about user creation, anyone?) finally get what they’ve been asking for. As a whole it’s still rather buggy, though. ;)