OLD | NEW |
| (Empty) |
1 #!/usr/bin/env python | |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
3 # Use of this source code is governed by a BSD-style license that can be | |
4 # found in the LICENSE file. | |
5 | |
6 import sys | |
7 import urllib | |
8 | |
9 from set_lkgr import get_pwd | |
10 | |
11 | |
12 def post(username, message, url='chromium-status.appspot.com'): | |
13 if not url.startswith('https://'): | |
14 url = 'https://' + url | |
15 data = { | |
16 'message': message, | |
17 'username': username, | |
18 'password': get_pwd(), | |
19 } | |
20 print url | |
21 out = urllib.urlopen(url + '/status', urllib.urlencode(data)).read() | |
22 print out | |
23 return 0 | |
24 | |
25 | |
26 if __name__ == '__main__': | |
27 if not (3 <= len(sys.argv) <= 4): | |
28 print('Usage: set_status.py username message [url]') | |
29 sys.exit(1) | |
30 | |
31 sys.exit(post(*sys.argv[1:])) | |
OLD | NEW |