[Chandler-dev] Introduction and questions
John Anderson
john at osafoundation.org
Tue Jun 20 11:12:39 PDT 2006
Travis wrote:
> Hi,
>
> First, for anyone that hasn't been around, I'd like to introduce
> myself. My name is Travis Vachon, and I'm the summer intern working on
> the Chandler platform team. I've been at OSAF a week now, and am
> enjoying myself quite a bit. The work I've been doing is interesting,
> and Chandler is quite interesting itself. I'm particularly impressed
> by some of the novel data management ideas incorporated into the
> Kind/Item and repository system.
>
> After a short project updating the feeds tutorial, I've been working
> on an idea first mentioned to me by Andi, and clarified by Grant.
> Essentially, I'm giving Chandler the ability to act like an IMAP
> server so that external mail programs like Thunderbird, Outlook, or
> the Mac mail program can easily interact with Chandler. Personally, I
> think the really interesting application of this is the ability to
> easily move items like scheduling e-mails from a mail client to
> Chandler, letting Chandler manage that data from then on. The other
> direction (that is, making Chandler MailMessages appear as IMAP mail
> messages), however, is also interesting, and kind of a step along the
> way of getting the whole thing working.
>
> One very nice thing about this project is that twisted makes
> implementing an IMAP server pretty easy. The devil is, of course, in
> the details, and much of my time has been spent figuring out the
> Chandler repository API, and getting used to the way things are done
> within Chandler.
>
> I have come up with a couple questions:
> First, it looks like Chandler has a way of handling MIME messages.
> From what I understand, twisted's MIME handling basically views all
> MIME messages as a tree of MessageParts. Is this tree structure
> reflected anywhere in Chandler's implementation? I couldn't really
> tell, so the way I am handling MIME messages right now is a little
> kludgy, converting back and forth to email.Message objects for a
> couple operations to accomodate some of the methods the IMAP server
> requires.
>
> Second, I've occasionally run into situations where it might be nice
> to persist a normal Python object in the repository (for example, an
> email.Message) but it seems this isn't possible. This seems to make
> sense from the standpoint of ensuring we have an efficient repository,
> but it seems like it would occasionally be inconvenient (for example,
> requiring one to rewrite significant portions of modules like email).
> Am I correct in thinking that this tradeoff was made?
On first glance, it looks like you could easily convert back and forth
between a string, which is easy to persist in an Item (there is probably
an existing email content item that probably already contains such a
string). and a python email.Message using message_from_string and as_string.
>
> Finally, a more specific problem:
>
> I'm using the watchKind method to register MailMessages as they come
> into Chandler as follows:
> class ChandlerIMailbox(schema.Item):
> .
> .
> .
> def __init__(self):
> self.watchKind(MailMessageMixin.getKind(self.itsView),
> self._message_added)
> def message_added(self, op, kind, names):
> print "Go through message adding steps here"
>
> This seems to go just fine, but when Chandler starts up, I get the
> following error message:
>
> Traceback (most recent call last):
> File "/Users/travis/chandler/chandler/application/Application.py",
> line 617, in OnCommand
> Block.post (blockEvent, arguments, block)
> File
> "/Users/travis/chandler/chandler/parcels/osaf/framework/blocks/Block.py",
> line 172, in post
> self.dispatchEvent (event)
> File
> "/Users/travis/chandler/chandler/parcels/osaf/framework/blocks/Block.py",
> line 1044, in dispatchEvent
> wx.GetApp().UIRepositoryView.commit()
> File
> "/Users/travis/chandler/chandler/repository/persistence/DBRepositoryView.py",
> line 536, in commit
> itemWriter)
> File
> "/Users/travis/chandler/chandler/repository/persistence/DBRepositoryView.py",
> line 600, in _saveItem
> return itemWriter.writeItem(item, newVersion)
> File
> "/Users/travis/chandler/chandler/repository/persistence/DBItemIO.py",
> line 54, in writeItem
> size = super(DBItemWriter, self).writeItem(item, version)
> File "/Users/travis/chandler/chandler/repository/item/ItemIO.py",
> line 43, in writeItem
> size += self._values(item, version, withSchema, all)
> File
> "/Users/travis/chandler/chandler/repository/persistence/DBItemIO.py",
> line 250, in _values
> return item._values._writeValues(self, version, withSchema, all)
> File "/Users/travis/chandler/chandler/repository/item/Values.py",
> line 169, in _writeValues
> withSchema, attribute)
> File
> "/Users/travis/chandler/chandler/repository/persistence/DBItemIO.py",
> line 317, in _value
> raise SaveValueError, (item, name, e)
> repository.persistence.RepositoryError.SaveValueError: While saving
> value for 'watcherDispatch' on <Extent (new):
> f32200d8-007f-11db-ae80-e122534d4185>: No handler for values of type
> <type 'instancemethod'>
>
>
> It looks like it doesn't like persisting the watcher method. I haven't
> mentioned the method in the schema for ChandlerIMailbox, do I have to?
> If so, how is this done? I can't find method or function as schema
> types in the documentation.
>
>
> Thank you again for the chance to work with you all on Chandler, I
> look forward to the rest of my time here!
>
> Travis Vachon
>
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> Open Source Applications Foundation "chandler-dev" mailing list
> http://lists.osafoundation.org/mailman/listinfo/chandler-dev
More information about the chandler-dev
mailing list