Complete.Org: Mailing Lists: Archives: offlineimap: July 2003:
Re: Direction comments
Home

Re: Direction comments

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jared Rhine <jared@xxxxxxxxxxx>
Cc: offlineimap@xxxxxxxxxxxx
Subject: Re: Direction comments
From: John Goerzen <jgoerzen@xxxxxxxxxxxx>
Date: Tue, 29 Jul 2003 09:15:22 -0500

On Mon, Jul 28, 2003 at 01:47:23AM -0700, Jared Rhine wrote:
> Well, maybe I'd like to help, but I'm not going to learn python just
> to help out.  As long as the code is monolithic, in a single process
> space, and not accessible via IPC, I can't really integrate with it.

Ah ha.  I see now where you were going with this and why you see it as
monolithic while I see it as highly modular :-)

OfflineIMAP is designed so that you can integrate with it easily.  You can,
in fact, create your own UI (or even Folder or Repository) modules, plonk
them down somewhere in your Python path, and tell OfflineIMAP to use 'em. 
(I haven't tested this, so if it doesn't work, a simple mod may be needed.)

This is my favorite way to make things adaptable from Python.  For instance,
with my PyGopherd server, you can run CGIs, but you can also run what I call
"PYG"s.  They get loaded up dynamically as a first-class handler, and can do
everything that something built in to the app can.

The same goes for OfflineIMAP modules.  If you write a new UI, it's a
first-class citizen, and nobody (not even OfflineIMAP) can tell the
difference.

I have generally seen this as an advantage.

As you point out, it requires modules to be written in Python.  To me, that
is not a disadvantage, but I can see how it is for some.  In fact, if you
don't want to use Python, it would indeed seem like a big monolithic black
box over there.

It would be quite easy to write a UI module that accepted connections on a
named pipe and shoved data down it.

> If it was IPC/socket/whatever based, I could throw together other UIs
> or extensions via my preferred mechanisms.  Not that I actually have
> any need to do so.

One side effect that Twisted can provide is that it has some built in
"shell-like server" capabilities.  OfflineIMAP could listen on a named pipe
and accept requests from whomever cares to request something.

You are probably correct that the UI could be split off using IPC without
too much effort or complexity, but the question facing me thus far is: why
bother? :-)

The rest of the program is not going to be so simple to do that.  The reason
is that there are a lot of interdependencies -- certain operations must
happen in a certain order, and sometimes not at all, etc.  Postfix has an
advantage there in that all mail is pretty much handled the same.  It comes
in, it gets rewritten, it goes out.

Would it be helpful for people if I write up a "hacking OfflineIMAP"
document?

I think that somebody that's already a skilled programmer in another
language (and is familiar with TCP communications) could probably get up to
speed enough with Python and OfflineIMAP to begin doing some basic stuff
within 2-3 hours.  I've often found that I can make sense of code written in
other languages and make small mods to it even before I could write code in
that language.

> Regardless of any of the above musings, I'm very happy with the
> codebase and your maintainership as it is.  My trust continues to grow
> and I believe I'll be pleased no matter what direction you take the
> project.

Thanks for the kind words!

-- John


[Prev in Thread] Current Thread [Next in Thread]