~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 06:41:06 UTC
  • Revision ID: william.grant@canonical.com-20120122064106-6at8ool919624m0z
Let the HTTP client decide count and order (to an extent).

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
 
 
22
19
import web
23
20
 
24
 
from grackle.model import CassandraConnection
 
21
from grackle.server.model import CassandraConnection
25
22
 
26
23
conn = None
27
24
 
61
58
        except (AttributeError, ValueError):
62
59
            count = 10
63
60
        order = getattr(args, 'order', '-date')
64
 
        memo = getattr(args, 'memo', '')
65
 
        prev, messages, next = conn.get_messages(name, order, count, memo)
66
 
        return json.dumps({
67
 
            'prev_memo': prev,
68
 
            'messages': messages,
69
 
            'next_memo': next,
70
 
            })
 
61
        return repr(conn.get_messages(name, count=count, order=order))
71
62
 
72
63
 
73
64
urls = (