Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Side by Side Diff: appengine_apps/chromium_status/tools/set_lkgr.py

Issue 778533003: Moved chromium_status to appengine/ (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 getpass
7 import os
8 import re
9 import sys
10 import urllib
11
12
13 def usage():
14 print('Usage: set_lkgr.py revision [git_hash [url]]')
15 sys.exit(1)
16
17
18 def get_pwd():
19 if os.path.isfile('.status_password'):
20 return open('.status_password', 'r').read().strip()
21 return getpass.getpass()
22
23
24 def post(revision, git_hash='', url='chromium-status.appspot.com'):
25 if not re.match('^([a-zA-Z0-9]{40})?$', git_hash):
26 print 'Git hash must match /^([a-zA-Z0-9]{40})?$/.'
27 usage()
28 if not url.startswith('https://') and not url.startswith('http://'):
29 url = 'https://' + url
30 if url.startswith('http://'):
31 print('WARNING: Using set_lkgr.py with an http:// url only works on '
32 'the dev_appserver.')
33 if raw_input('Continue (y/N): ').lower() != 'y':
34 print 'Aborting.'
35 sys.exit(1)
36 data = {
37 'revision': revision,
38 'success': 1,
39 'git_hash': git_hash,
40 'password': get_pwd(),
41 }
42 print url
43 out = urllib.urlopen(url + '/revisions', urllib.urlencode(data)).read()
44 print out
45 return 0
46
47
48 if __name__ == '__main__':
49 if not (2 <= len(sys.argv) <= 4):
50 usage()
51
52 sys.exit(post(*sys.argv[1:]))
OLDNEW
« no previous file with comments | « appengine_apps/chromium_status/tools/run_local_server.sh ('k') | appengine_apps/chromium_status/tools/set_status.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698