Mercurial > code > home > repos > homeauto
comparison service/speechMusic/speechMusic.py @ 841:ddc2cdbfde50
rdflib and jsonlib api updates
Ignore-this: feb4c3bee7704dee42f1d3a01b20f4e8
darcs-hash:20120808062410-312f9-2d5e41e2bb782e0e3946af63c6bbaf695f23fc16
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Tue, 07 Aug 2012 23:24:10 -0700 |
parents | d17164dbd15f |
children | 1132ab1ade80 |
comparison
equal
deleted
inserted
replaced
840:afc74853a1a4 | 841:ddc2cdbfde50 |
---|---|
1 #!bin/python | 1 #!bin/python |
2 | 2 |
3 """ | 3 """ |
4 play sounds according to POST requests. cooperate with pubsubhubbub | 4 play sounds according to POST requests. cooperate with pubsubhubbub |
5 """ | 5 """ |
6 import web, sys, jsonlib, subprocess, os, tempfile, logging | 6 import web, sys, json, subprocess, os, tempfile, logging |
7 from subprocess import check_call | 7 from subprocess import check_call |
8 sys.path.append("/my/proj/csigen") | 8 sys.path.append("/my/proj/csigen") |
9 from generator import tts | 9 from generator import tts |
10 import xml.etree.ElementTree as ET | 10 import xml.etree.ElementTree as ET |
11 logging.basicConfig(level=logging.INFO, format="%(created)f %(asctime)s %(levelname)s %(message)s") | 11 logging.basicConfig(level=logging.INFO, format="%(created)f %(asctime)s %(levelname)s %(message)s") |
62 | 62 |
63 aplay('living', outName) | 63 aplay('living', outName) |
64 | 64 |
65 class visitorNet(object): | 65 class visitorNet(object): |
66 def POST(self): | 66 def POST(self): |
67 data = jsonlib.loads(web.data()) | 67 data = json.loads(web.data()) |
68 if 'name' not in data: | 68 if 'name' not in data: |
69 data['name'] = 'unknown' | 69 data['name'] = 'unknown' |
70 | 70 |
71 if data.get('action') == 'arrive': | 71 if data.get('action') == 'arrive': |
72 | 72 |