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

« back to all changes in this revision

Viewing changes to grackle/wsgi.py

  • Committer: William Grant
  • Date: 2012-01-22 10:39:15 UTC
  • Revision ID: william.grant@canonical.com-20120122103915-lqjw4jsaw3ug1q2g
Merge grackle.server into grackle. Alter Makefile to run all the tests.

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
 
from grackle.server.model import CassandraConnection
 
24
from grackle.model import CassandraConnection
22
25
 
23
26
conn = None
24
27
 
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 = (