diff options
author | rcoh <rcoh@mit.edu> | 2011-01-29 19:30:21 -0500 |
---|---|---|
committer | rcoh <rcoh@mit.edu> | 2011-01-29 19:30:21 -0500 |
commit | ab7a4c8a8eeb1b47099daa81de1be45a3bbd39db (patch) | |
tree | ddfcf0249eb9470bc0083451d29447e598339e3b /testosc.py | |
parent | ccb6ea18285a26b8cc8d99ae7d6540f8ca792398 (diff) | |
parent | 61d3da8be78c093384b7f87c854c09c255f6384e (diff) |
Merge branch 'osc' of github.com:rcoh/SmootLight
Diffstat (limited to 'testosc.py')
-rwxr-xr-x | testosc.py | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/testosc.py b/testosc.py deleted file mode 100755 index cea03f4..0000000 --- a/testosc.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python - -import liblo, sys - -# create server, listening on port 1234 -try: - server = liblo.Server(12345) -except liblo.ServerError, err: - print str(err) - sys.exit() - -def foo_bar_callback(path, args): - i, f = args - print "received message '%s' with arguments '%d' and '%f'" % (path, i, f) - -def foo_baz_callback(path, args, types, src, data): - print "received message '%s'" % path - print "blob contains %d bytes, user data was '%s'" % (len(args[0]), data) - -def fallback(path, args, types, src): - print "got unknown message '%s' from '%s'" % (path, src.get_url()) - for a, t in zip(args, types): - print "argument of type '%s': %s" % (t, a) - -# register method taking an int and a float -server.add_method("/foo/bar", 'if', foo_bar_callback) - -# register method taking a blob, and passing user data to the callback -server.add_method("/foo/baz", 'b', foo_baz_callback, "blah") - -# register a fallback for unhandled messages -server.add_method(None, None, fallback) - -# loop and dispatch messages every 100ms -while True: - server.recv(100) |