~didrocks/unity/altf10

« back to all changes in this revision

Viewing changes to grackle-put-message

  • Committer: Curtis Hovey
  • Date: 2012-01-31 05:24:10 UTC
  • mfrom: (35.1.19 client-get-messages-0)
  • Revision ID: curtis.hovey@canonical.com-20120131052410-4n5iva4ujik6nhp8
Added support for display_type.
Introduced make_message and make_mime_message to make test data consistent for
InMemoryStore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
import sys
3
3
from grackle import client
4
4
 
 
5
 
5
6
class UserError(Exception):
6
7
    """An error caused by a user mistake."""
7
8
 
 
9
 
8
10
def main(*args):
9
 
    if len(args) != 1:
 
11
    if len(args) != 2:
10
12
        raise UserError("Wrong number of arguments supplied.")
11
 
    client.put_message(args[0], sys.stdin)
 
13
    grackle = client.GrackleClient('localhost', 8123)
 
14
    grackle.put_message(args[0], args[1], sys.stdin)
12
15
 
13
16
 
14
17
if __name__ == '__main__':