Tinymail python bindings
There has been a lot of work done already in creating the initial python bindings for Tinymail. The source tree auto generates the bindings using the PyGObject / PyGtk? tools and using this method the majority of the API has been wrapped in Python calls. There is a working demo of the python bindings in /test/python-demo/ that implements a minimal mail client. The PyGtk? tools give an estimated coverage of the C API and shows that the Tinymail core library was roughly 90% covered by the automated bindings generation.For both the Tinymail and TinymailUI libraries the interfaces can be implemented by python classes, and all virtual methods of classes can be overridden.
Current work
Eventually the core Tinymail API needs to be completely wrapped in Python calls. This Python interface needs to be well tested and documented. As a precursor to this the goal is to improve the python demo code and implement more of its functionality in Python. This is so that the automatically generated python bindings are exercised and the important missing functionality can be added as features are added to the python client.
The majority of methods that are Incomplete relate to TnyAccount and TnyFolder.
Allow use of the Camel implementation of the core API
Again the majority of unfinished methods relate to TnyCamelAccount and TnyCamelFolder. These method calls need to be wrapped so that they are accessible in Python. The types CamelSession? and CamelStream? also need to be made accessible in Python if a TnyAccountStore is to be implemented outside of 'C'.
Implement parts of the Tinymail API in Python
The python demo code does not do very much work outside of 'C'. It uses a default platform-factory, and default implementations of all the API's. To properly build a mail client we need to enable some of the interfaces to be implemented.
Initial work will implement in python: TnyAccountStore, TnyPlatformFactory, TnyList, TnyIterator and TnyDevice.
TnyDevice - The python implementation of this interface will use dbus-python to access the network manager for updates on the connectivity status.
TnyPlatformFactory - Will return a TnyCamelStoreAccount, TnyCamelMsg, TnyCamelMimePart, TnyGtkPasswordDialog, TnyGtkMsgView. It will return the implemented TnyDevice and TnyAccountStore.
TnyAccountStore - Will implement the loading and saving of account data in Python. Will use the TnyCamelIMAPStoreAccount and the TnyPasswordGetter TnyGtkPasswordDialog.
TnyList and TnyIterator - Use a python list and tuple.
Extend the Python demo to a more fully featured mail client
The first mail client will mix the tinymailui-gtk implementation, with some of the interface implemented in python.
It will support:
- Sending and receiving mail via IMAP and SMTP.
- Browsing folders of the IMAP account.
- Entering account details to IMAP and SMTP.
- Browsing summaries of message headers.
- Composing and reading text e-mails.
It should make full use of: TnyAccount, TnyMsg, TnyMimePart, TnyStoreAccount, TnyTransportAccount, TnyFolderStore, TnyFolder.
Moving the python bindings to other supported platforms
The python bindings will be enhanced so that it is possible to implement all of the TinymailUI API within python. Python bindings libraries will be built for the OLPC / XO platform.
An implementation of a mail client will be built for the XO platform. This will also the Gtk implementation of the UI interface to create the client. From this base the UI could be reimplemented, to provide a Sugar UI feel. The implementations for TnyDevice, TnyAccountStore and TnyPlatformFactory should be portable to the XO, although will be modified to allow more options for TnyAccount. Later they may be modified to use the different UI elements.
Extensions
Doc strings and Documentation
The most necessary extension to the work is to allow the python doc strings to be generated, preferably using some auto-generation of the Tinymail docs, along with some hand modification.
Complete a production client for the OLPC platform
Re implement the UI to provide a sugar look and feel as well as extending the functionality of the Python mail client to use all Transport types and Mime Types. Provide python bindings for the Mozilla Embedded TnyMsgView and TnyMimePart interfaces to display HTML messages.
Implement python protocols for Tinymail types
This is making python programmers feel more at home using the Tinymail module. For example, the TnyFolder type has a method to get all headers. Should python programmers be able to call "for header in folder:" to iterate over headers in a folder. Are there any classes in the Tinymail framework that need to be compared by value rather than reference. How should the TnyIterator object be represented in python, which has its own iterators. This is a large body of work that would be beneficial to the bindings, but not break the python API.
