1
#! /usr/bin/env python 
2
import gobject
3
4
from tinymail.ui import PlatformFactory
5
from xmlaccountstore import XmlAccountStore
6
from tinymail.uigtk import GtkMsgView
7
from tinymail.camel import CamelMsg
8
from tinymail.camel import CamelMimePart
9
from tinymail.uigtk import GtkPasswordDialog
10
11
class PyPlatformFactory(gobject.GObject, PlatformFactory):
12
	"""
13
	An implementation of the Tinymail platform facory interface
14
	that depends on Gtk, Network manager, Dbus, and Camel. Uses
15
	an XML file in the users home directory to store accounts. 
16
	"""
17
	def __init__(self):
18
		gobject.GObject.__init__(self)
19
20
	def do_new_account_store(self):
21
		return XmlAccountStore('tinymailacc.xml')
22
23
	def do_new_msg_view(self):
24
		return GtkMsgView()
25
26
	def do_new_msg(self):
27
		return CamelMsg()
28
29
	def do_new_mime_part(self):
30
		return CamelMimePart()
31
32
	def do_new_password_getter(self):
33
		return GtkPasswordDialog()
34
35
gobject.type_register(PyPlatformFactory)