3
# This is an example of accessing the new ScreenletService. It can be used
4
# to access signals and methods within a Screenlet from other applications or
7
# import services-module
8
import screenlets.services
10
# check if our needed service is running, exit if not
11
if not screenlets.services.service_is_running('MailCheck'):
12
print "MailCheckScreenlet is not running."
16
# get interface to the MailCheckScreenlet's service
17
mc = screenlets.services.get_service_by_name('MailCheck')
19
# if interface was returned,
22
# get id of first instance (we only want one here)
23
instance_id = mc.get_first_instance()
25
print "try getting/setting normal values"
26
print mc.get(instance_id, 'x')
27
mc.set(instance_id, 'x', 400)
29
print "try getting/setting protected values"
30
print mc.get(instance_id, 'pop3_account')
31
mc.set(instance_id, 'pop3_account', ('user', 'pass'))
33
# start mainloop (needed to receive events)
35
mainloop = gobject.MainLoop()
39
print "Error: " + str(e)