Skip to content

Commit 76d229b

Browse files
committed
Initial voice input
1 parent 23f35f9 commit 76d229b

30 files changed

+3059
-53
lines changed

Tris/__init__.pyc

0 Bytes
Binary file not shown.

Tris/controllers/default.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,28 @@ def login_home():
2828

2929
def text():
3030
return dict()
31-
31+
@auth.requires_login()
3232
def upload_file():
3333
form = SQLFORM(db.notes_upload)
3434
form.process()
3535
return dict(form = form)
3636

37-
37+
@auth.requires_login()
3838
def view_uploads():
3939
rows = db(db.notes_upload.email==auth.user.email).select(db.notes_upload.ALL)
4040
return dict(rows = rows)
41-
41+
@auth.requires_login()
4242
def temp():
4343
db.text1.insert(note=request.get_vars['note'], font=request.get_vars['font'], title=request.get_vars['title'])
4444
return dict()
4545

46-
46+
@auth.requires_login()
47+
def voice_upload():
48+
return dict()
49+
@auth.requires_login()
50+
def voicedb():
51+
db.voice.insert(note=request.get_vars['text'],title=request.get_vars['head'])
52+
return dict()
4753
def user():
4854
"""
4955
exposes:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
(dp1
2+
S'note'
3+
p2
4+
(dp3
5+
S'length'
6+
p4
7+
I512
8+
sS'unique'
9+
p5
10+
I00
11+
sS'sortable'
12+
p6
13+
I4
14+
sS'sql'
15+
p7
16+
S'CHAR(512)'
17+
p8
18+
sS'notnull'
19+
p9
20+
I00
21+
sS'type'
22+
p10
23+
S'string'
24+
p11
25+
ssS'title'
26+
p12
27+
(dp13
28+
g4
29+
I512
30+
sg5
31+
I00
32+
sg6
33+
I5
34+
sg7
35+
S'CHAR(512)'
36+
p14
37+
sg9
38+
I00
39+
sg10
40+
g11
41+
ssS'added'
42+
p15
43+
(dp16
44+
g4
45+
I512
46+
sg5
47+
I00
48+
sg6
49+
I3
50+
sg7
51+
S'TIMESTAMP'
52+
p17
53+
sg9
54+
I00
55+
sg10
56+
S'datetime'
57+
p18
58+
ssS'id'
59+
p19
60+
(dp20
61+
g4
62+
I512
63+
sg5
64+
I00
65+
sg6
66+
I1
67+
sg7
68+
S'INTEGER PRIMARY KEY AUTOINCREMENT'
69+
p21
70+
sg9
71+
I00
72+
sg10
73+
g19
74+
ssS'email'
75+
p22
76+
(dp23
77+
g4
78+
I512
79+
sg5
80+
I00
81+
sg6
82+
I2
83+
sg7
84+
S'CHAR(512)'
85+
p24
86+
sg9
87+
I00
88+
sg10
89+
g11
90+
ss.

Tris/databases/sql.log

+89
Original file line numberDiff line numberDiff line change
@@ -1495,3 +1495,92 @@ success!
14951495
success!
14961496
success!
14971497
success!
1498+
success!
1499+
success!
1500+
success!
1501+
success!
1502+
success!
1503+
success!
1504+
success!
1505+
success!
1506+
success!
1507+
success!
1508+
success!
1509+
success!
1510+
success!
1511+
success!
1512+
success!
1513+
success!
1514+
success!
1515+
success!
1516+
success!
1517+
success!
1518+
success!
1519+
success!
1520+
success!
1521+
success!
1522+
success!
1523+
success!
1524+
success!
1525+
success!
1526+
success!
1527+
success!
1528+
success!
1529+
success!
1530+
success!
1531+
success!
1532+
success!
1533+
success!
1534+
success!
1535+
success!
1536+
success!
1537+
success!
1538+
success!
1539+
success!
1540+
success!
1541+
success!
1542+
success!
1543+
success!
1544+
success!
1545+
success!
1546+
success!
1547+
success!
1548+
success!
1549+
success!
1550+
success!
1551+
success!
1552+
success!
1553+
success!
1554+
success!
1555+
success!
1556+
success!
1557+
success!
1558+
success!
1559+
success!
1560+
success!
1561+
success!
1562+
success!
1563+
timestamp: 2014-04-12T16:21:38.931272
1564+
CREATE TABLE voice(
1565+
id INTEGER PRIMARY KEY AUTOINCREMENT,
1566+
email CHAR(512),
1567+
added TIMESTAMP,
1568+
note CHAR(512),
1569+
title CHAR(512)
1570+
);
1571+
success!
1572+
success!
1573+
success!
1574+
success!
1575+
success!
1576+
success!
1577+
success!
1578+
success!
1579+
success!
1580+
success!
1581+
success!
1582+
success!
1583+
success!
1584+
success!
1585+
success!
1586+
success!

Tris/databases/storage.sqlite

3 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
(dp1
2+
S'output'
3+
p2
4+
S"<type 'exceptions.AttributeError'> 'DAL' object has no attribute 'notes_upload'"
5+
p3
6+
sS'layer'
7+
p4
8+
S'/home/vamsee/web2py/applications/Tris/controllers/default.py'
9+
p5
10+
sS'code'
11+
p6
12+
S' # -*- coding: utf-8 -*-\n# this file is released under public domain and you can use without limitations\n\n#########################################################################\n## This is a sample controller\n## - index is the default action of any application\n## - user is required for authentication and authorization\n## - download is for downloading files uploaded in the db (does streaming)\n## - call exposes all registered services (none by default)\n#########################################################################\n\n\ndef index():\n """\n example action using the internationalization operator T and flash\n rendered by views/default/index.html or views/generic.html\n\n if you need a simple wiki simply replace the two lines below with:\n return auth.wiki()\n """\n response.flash = T("Welcome to web2py!")\n return dict(message=T(\'Hello World\'))\n\n\[email protected]_login()\ndef login_home():\n return dict()\n\ndef text():\n return dict()\n\ndef upload_file():\n form = SQLFORM(db.notes_upload)\n form.process()\n return dict(form = form)\n\n\ndef view_uploads():\n rows = db(db.notes_upload.email==auth.user.email).select(db.notes_upload.ALL) \n return dict(rows = rows)\n\ndef temp():\n db.text1.insert(note=request.get_vars[\'note\'], font=request.get_vars[\'font\'], title=request.get_vars[\'title\'])\n return dict()\n \n\ndef user():\n """\n exposes:\n http://..../[app]/default/user/login\n http://..../[app]/default/user/logout\n http://..../[app]/default/user/register\n http://..../[app]/default/user/profile\n http://..../[app]/default/user/retrieve_password\n http://..../[app]/default/user/change_password\n http://..../[app]/default/user/manage_users (requires membership in\n use @auth.requires_login()\n @auth.requires_membership(\'group name\')\n @auth.requires_permission(\'read\',\'table name\',record_id)\n to decorate functions that need access control\n """\n return dict(form=auth())\n\[email protected]()\ndef download():\n """\n allows downloading of uploaded files\n http://..../[app]/default/download/[filename]\n """\n return response.download(request, db)\n\n\ndef call():\n """\n exposes services. for example:\n http://..../[app]/default/call/jsonrpc\n decorate with @services.jsonrpc the functions to expose\n supports xml, json, xmlrpc, jsonrpc, amfrpc, rss, csv\n """\n return service()\n\n\[email protected]_signature()\ndef data():\n """\n http://..../[app]/default/data/tables\n http://..../[app]/default/data/create/[table]\n http://..../[app]/default/data/read/[table]/[id]\n http://..../[app]/default/data/update/[table]/[id]\n http://..../[app]/default/data/delete/[table]/[id]\n http://..../[app]/default/data/select/[table]\n http://..../[app]/default/data/search/[table]\n but URLs must be signed, i.e. linked with\n A(\'table\',_href=URL(\'data/tables\',user_signature=True))\n or with the signed load operator\n LOAD(\'default\',\'data.load\',args=\'tables\',ajax=True,user_signature=True)\n """\n return dict(form=crud())\n\nresponse._vars=response._caller(upload_file)\n'
13+
p7
14+
sS'snapshot'
15+
p8
16+
(dp9
17+
sS'traceback'
18+
p10
19+
S'Traceback (most recent call last):\n File "/home/vamsee/web2py/gluon/restricted.py", line 217, in restricted\n exec ccode in environment\n File "/home/vamsee/web2py/applications/Tris/controllers/default.py", line 100, in <module>\n File "/home/vamsee/web2py/gluon/globals.py", line 385, in <lambda>\n self._caller = lambda f: f()\n File "/home/vamsee/web2py/applications/Tris/controllers/default.py", line 33, in upload_file\n form = SQLFORM(db.notes_upload)\n File "/home/vamsee/web2py/gluon/dal.py", line 8329, in __getattr__\n return ogetattr(self, key)\nAttributeError: \'DAL\' object has no attribute \'notes_upload\'\n'
20+
p11
21+
s.

Tris/errors/127.0.0.1.2014-04-10.18-47-30.4afa6d43-5142-4163-ad1f-9ec7a7b88cd4

+759
Large diffs are not rendered by default.

Tris/models/db.py

+5
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,8 @@
9393
else:
9494
db.define_table('notes_upload',Field('email','string', default=auth.user.email), Field('added', 'datetime', default=datetime.datetime.now()), Field('note', 'upload'))
9595
auth.settings.login_next = URL('login_home')
96+
if auth.user is None:
97+
pass
98+
else:
99+
db.define_table('voice',Field('email','string',default=auth.user.email),Field('added','datetime',default=datetime.datetime.now()),Field('note','string'),Field('title','string'))
100+
auth.settings.login_next=URL('login_home')

Tris/modules/__init__.pyc

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)