Пример #1
0
def test(name):
    t = Table('user.db')
    filename = '/%s' % name.encode('utf-8')
    b = t.find(filename)

    f = Response(StreamBlock(b,t), mimetype='application/octet-stream')
    f.content_language = str(b.length)
    return f
Пример #2
0
def get(name):
    t = Table('user.db')
    filename = '/%s' % name.encode('utf-8')
    b = t.find(filename)
    if b:
        x = t.read(b)
    else:
        x = '', 404
    del t
    return x