Exemplo n.º 1
0
import kns

def callback(directive, options):
    print "This is the callback."
    print "\tDirective: " + directive
    print "\tText: " + options["text"]

params = {'text': 'Hello, there!'}
result = kns.raise_event("test", "started", "a163x36", params, callback, True)

print "\nThe raw directives were the following: \n%s" % result

Exemplo n.º 2
0
import kns

# Raises the "coming_home" event, which is handled by the ruleset
result = kns.raise_event("phone", "incoming_call", "a163x128", {}, None, True)
print result
Exemplo n.º 3
0
import kns

# Raises the "coming_home" event, which is handled by the ruleset
result = kns.raise_event("location", "nearing_home", "a163x128", {}, None, True)
print result