2 import org.maemo.hermes.engine.provider
3 import org.maemo.hermes.engine.twitter.service
5 class Provider(org.maemo.hermes.engine.provider.Provider):
6 """Twitter provider for Hermes.
8 Copyright (c) Andrew Flegg <andrew@bleb.org> 2010.
9 Released under the Artistic Licence."""
12 # -----------------------------------------------------------------------
14 self._gconf = gnome.gconf.client_get_default()
17 # -----------------------------------------------------------------------
19 """Return the display name of this service. An icon, of with the lower-case,
20 all-alphabetic version of this name is expected to be provided."""
25 # -----------------------------------------------------------------------
26 def has_preferences(self):
27 """Whether or not this provider has any preferences. If it does not,
28 open_preferences must NOT be called; as the behaviour is undetermined."""
33 # -----------------------------------------------------------------------
34 def open_preferences(self, parent):
35 """Open the preferences for this provider as a child of the 'parent' widget."""
37 print "Err, open preferences. OK. Err, right. Hmm."
40 # -----------------------------------------------------------------------
41 def service(self, gui_callback):
42 """Return the service backend. This must be a class which implements the
48 See Service for more details."""
50 username = self._gconf.get_string("/apps/maemo/hermes/twitter_user") or ''
51 password = self._gconf.get_string("/apps/maemo/hermes/twitter_pwd") or ''
53 return org.maemo.hermes.engine.twitter.service.Service(username, password, gui_callback)