From cb69d2e1c7ced951cbf7a31ee286b0ed92cab8a8 Mon Sep 17 00:00:00 2001 From: rcoh Date: Fri, 18 Feb 2011 16:56:43 -0500 Subject: Adding Epydoc generated docs. --- html/SmootLight.tests.testosc-pysrc.html | 149 +++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 html/SmootLight.tests.testosc-pysrc.html (limited to 'html/SmootLight.tests.testosc-pysrc.html') diff --git a/html/SmootLight.tests.testosc-pysrc.html b/html/SmootLight.tests.testosc-pysrc.html new file mode 100644 index 0000000..f5583d4 --- /dev/null +++ b/html/SmootLight.tests.testosc-pysrc.html @@ -0,0 +1,149 @@ + + + + + SmootLight.tests.testosc + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package SmootLight :: + Package tests :: + Module testosc + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module SmootLight.tests.testosc

+
+ 1  #!/usr/bin/env python 
+ 2   
+ 3  import liblo, sys 
+ 4   
+ 5  # create server, listening on port 1234 
+ 6  try: 
+ 7      server = liblo.Server(1234) 
+ 8  except liblo.ServerError, err: 
+ 9      print str(err) 
+10      sys.exit() 
+11   
+
12 -def foo_bar_callback(path, args): +
13 i, f = args +14 print "received message '%s' with arguments '%d' and '%f'" % (path, i, f) +
15 +
16 -def foo_baz_callback(path, args, types, src, data): +
17 print "received message '%s'" % path +18 print "blob contains %d bytes, user data was '%s'" % (len(args[0]), data) +
19 +
20 -def fallback(path, args, types, src): +
21 print "got unknown message '%s' from '%s'" % (path, src.get_url()) +22 for a, t in zip(args, types): +23 print "argument of type '%s': %s" % (t, a) +
24 +25 # register method taking an int and a float +26 server.add_method("/foo/bar", 'if', foo_bar_callback) +27 +28 # register method taking a blob, and passing user data to the callback +29 server.add_method("/foo/baz", 'b', foo_baz_callback, "blah") +30 +31 # register a fallback for unhandled messages +32 server.add_method(None, None, fallback) +33 +34 # loop and dispatch messages every 100ms +35 while True: +36 server.recv(100) +37 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + -- cgit v1.2.3