~unity-2d-team/unity-2d/Shell-MultiMonitor

« back to all changes in this revision

Viewing changes to grackle/server/wsgi.py

  • Committer: William Grant
  • Date: 2012-01-22 07:10:23 UTC
  • Revision ID: william.grant@canonical.com-20120122071023-kwq8o5fvm6q9beys
Support batching.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
__metaclass__ = type
18
18
 
 
19
import json
 
20
import uuid
 
21
 
19
22
import web
20
23
 
21
24
from grackle.server.model import CassandraConnection
58
61
        except (AttributeError, ValueError):
59
62
            count = 10
60
63
        order = getattr(args, 'order', '-date')
61
 
        return repr(conn.get_messages(name, count=count, order=order))
 
64
        start = getattr(args, 'start', '')
 
65
        if start:
 
66
            start = uuid.UUID(start)
 
67
        messages, next_memo = conn.get_messages(name, order, count, start)
 
68
        return json.dumps({
 
69
            'messages': messages,
 
70
            'next_memo': next_memo,
 
71
            })
62
72
 
63
73
 
64
74
urls = (