Ejemplo n.º 1
0
def queue(request):
    started = int(request.GET.get('started'))
    print "started: " + str(started)
    if started > 0:
        print "Poem has started!"
        q_idx = int(request.GET.get('queue'))
        start_idx = int(request.GET.get('start'))
        bookmark = start_idx + q_idx % 10
        print "where at: " + str(q_idx)
        print "starting point: " + str(start_idx)
    else: 
        bookmark = cache.get('bookmark')
        print "bookmark: " + str(bookmark)  
        
    words = {'bookmark': bookmark, 'words' : cache.get(bookmark)}  
    if words['words'] is None: words = { 'bookmark': -1, 'words' : ['wait', 'wait'] }
    print words
    return wrap_response(words)
Ejemplo n.º 2
0
def controls(request):
    controls = request.GET
    current = cache.get('controls')
    cache.set('controls', controls)
    print cache.get('controls')
    return wrap_response(current)