Skip to content. | Skip to navigation

Sections
Personal tools
What is this?
Hi, my name is Tom Lazar and I'm a Plone and Zope developer based in Berlin, Germany and this is my personal and professional (no big difference, really...) website.
 

textmate

Aug 18, 2006

Zope, XML-RPC and DateTime

Filed Under:

One word: duh!

And here I was, wondering all along why TextMate's neat Blogging bundle didn't work with Quills' MetaWeblogAPI implementation. When retrieving or posting an entry it would always barf at the entry's dateCreated attribute. Being the author^Wculprit of Quills MetaWeblogAPI I figured, I might be doing something wrong here. And sure enough: turns out I'm returning the date in RFC822 format, whereas the XML-RPC spec requires ISO8601.
So, I changed it, but still no dice. WTF? Using the indispensable XML-RPC Client debugger I noticed, that a Wordpress instance that I used as reference returned the following XML-RPC for dateCreated:
<member>
    <name>dateCreated</name>
    <value>
        <dateTime.iso8601>20060713T19:04:45</dateTime.iso8601>
    </value>
</member>

whereas Quills...

<member>
    <name>dateCreated</name>
    <value>
        <string>2006-08-19T00:33:47+02:00</string>
    </value>
</member>
...returned a String object, not a DateTime object... But returning a DateTime object
        struct = {
'postid': obj.UID(),
'dateCreated': obj.effective(),
[...]

resulted in a exceptions.OverflowError - long int exceeds XML-RPC limits... *sigh* Turns out, Zope's XMLRPC library only learned how to deal with DateTime objects as recently as in version 2.9.3(!) -- whereas tomster.org is being hosted on 2.8.8.

At this point I was in no mood to give up -- I had gone too far already. So I migrated tomster.org to Zope2.9.4 and sure enough! Quills now returned a XML-RPC DateTime object, w00t! Except... it looks like this
<dateTime.iso8601>2006-08-19T00:33:47+02:00</dateTime.iso8601>

instead of

<dateTime.iso8601>20060713T19:04:45</dateTime.iso8601>
and so the blogging client still barfs on it!!
I was just about to dig further, when I noticed that Zope2.9.4 was segfaulting with the Data.fs of tomster.org ca. once every minute... I guess it just wasn't meant to be...
Now I'm back at Zope 2.8.8, a little bit wiser regarding XML-RPC... and still writing blog entries in Kupu... And if you've read this entry all the way to here, you probably should consider getting a life. I know, I am ;-)

Mar 05, 2005

More is Less

Filed Under:

One neat feature of TextMate is the way you (i.e. 'the user') can extend its functionality by creating 'Bundles'.

To make sharing these useful buggers easier, Allen (TextMate's author) has set up a separate subversion repository for which every Bundle-author can get write-access to.

While this is great to make TextMate useful for all kinds of cases and should cement its value as 'swiss army knife' it also means that the 'Automation' interface can become quite cluttered and that many useful keybindings have been 'taken away' by a Bundle that you don't even use.

So, I decided to catch two birds with one stone (is that the correct version of that proverb? In German it's "Zwei Fliegen mit einer Klappe"...) i.e. to update TextMate's, uhm... bundled bundles to subversion and unclutter it a bit. Symbolic links to the rescue:

cd /Applications/TextMate.app/Contents/SharedSupport/
mv Bundles Bundles-orig
svn --username anon --password anon co \
  http://macromates.com/svn/Bundles/trunk/
mkdir Bundles
cd Bundles
ln -s ../trunk/Defaults.tmbundle
ln -s ../trunk/Diff.tmbundle
ln -s ../trunk/HTML.tmbundle
ln -s ../trunk/Invisibles.tmbundle
ln -s ../trunk/LanguageDefinition.tmbundle
ln -s ../trunk/Outlines.tmbundle
ln -s ../trunk/PropertyList.tmbundle
ln -s ../trunk/Python.tmbundle
ln -s ../trunk/SQL.tmbundle
ln -s ../trunk/Subversion.tmbundle
ln -s ../trunk/Text\ Utilities.tmbundle
ln -s ../trunk/UnComment.tmbundle
ln -s ../trunk/UnixShell.tmbundle
ln -s ../trunk/XML.tmbundle
ln -s ../trunk/Scripts 
ln -s ../trunk/Tools 

Up next: using all the freed up keybindings to make TextMate behave more like the editing mode of MarsEdit and then use it for writing blog entries...