blob: c44b1b25010ac2fb5ab9fd6fc6adeea6be08c8dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/usr/bin/python
"""A more complex provider with a horroristic theme."""
from ContextKit.flexiprovider import *
import gobject
count = 0
def there_are_more():
global count
count += 1
fp.set('Zombie.Count', count)
if count == 2:
fp.add_and_update(STRING('You.Shout'))
fp.set('You.Shout', 'omg zombies!')
if count == 5:
fp.set('Life.isInDanger', True)
return True
gobject.timeout_add_seconds(2, there_are_more)
fp = Flexiprovider([INT('Zombie.Count'), TRUTH('Life.isInDanger')],
'omg.zombies', 'session')
fp.run()
|