コード例 #1
0
ファイル: example.py プロジェクト: snay2/kns-python
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

コード例 #2
0
ファイル: incoming.py プロジェクト: snay2/home-emulator
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
コード例 #3
0
ファイル: raise-events.py プロジェクト: snay2/home-emulator
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