4 This script works with mod_python to browse a collection of annotated wav files
7 you will need to have at least the following packages need to be installed (the
8 name of the command line tool is precised in parenthesis):
10 libapache-mod-python (apache2 prefered)
11 sndfile-programs (sndfile-info)
16 Try the command line tools in aubio/python to test your installation.
18 NOTE: this script is probably horribly insecure.
20 example configuration for apache to put in your preferred virtual host.
22 <Directory /home/piem/public_html/aubioweb>
24 AddHandler mod_python .py
25 # Disable these in production
28 # Default handler in url
29 PythonHandler aubioweb
30 ## Authentication stuff (optional)
31 #PythonAuthenHandler aubioweb
33 #AuthName "Restricted Area"
35 # make default listing
36 DirectoryIndex aubioweb/
41 from aubio.web.html import *
44 from aubio.web.browser import *
45 from mod_python import Session
46 req.sess = Session.Session(req)
47 req.sess['login']='new aubio user'
49 return configure_handler(req,index)
51 def index(req,threshold='0.3'):
53 print_command(req,"sfinfo %%i")
56 def show_info(req,verbose=''):
58 print_command(req,"sndfile-info %%i")
64 Please provide feedback below:
66 <form action="/~piem/aubioweb/email" method="POST">
67 Name: <input type="text" name="name"><br>
68 Email: <input type="text" name="email"><br>
69 Comment: <textarea name="comment" rows=4 cols=20></textarea><br>
74 WEBMASTER='piem@calabaza'
75 SMTP_SERVER='localhost'
77 def email(req,name,email,comment):
79 # make sure the user provided all the parameters
80 if not (name and email and comment):
81 return "A required parameter is missing, \
82 please go back and correct the error"
83 # create the message text
89 I have the following comment:
97 """ % (email, WEBMASTER, comment, name)
99 conn = smtplib.SMTP(SMTP_SERVER)
101 conn.sendmail(email, [WEBMASTER], msg)
102 except smtplib.SMTPSenderRefused:
103 return """<html>please provide a valid email</html>"""
106 # provide feedback to the user
110 Thank You for your kind comments, we
111 will get back to you shortly.