~didrocks/unity/altf10

« back to all changes in this revision

Viewing changes to grackle-put-message

  • Committer: Aaron Bentley
  • Date: 2012-01-11 11:18:15 UTC
  • Revision ID: aaron@canonical.com-20120111111815-0ecv9fihdao2u68o
Start working on GET.

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