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

Side by Side Diff: chrome/tools/extract_actions.py

Issue 8680018: Fix python scripts in src/chrome/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/tools/check_grd_for_unused_strings.py ('k') | chrome/tools/extract_histograms.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Extract UserMetrics "actions" strings from the Chrome source. 6 """Extract UserMetrics "actions" strings from the Chrome source.
7 7
8 This program generates the list of known actions we expect to see in the 8 This program generates the list of known actions we expect to see in the
9 user behavior logs. It walks the Chrome source, looking for calls to 9 user behavior logs. It walks the Chrome source, looking for calls to
10 UserMetrics functions, extracting actions and warning on improper calls, 10 UserMetrics functions, extracting actions and warning on improper calls,
11 as well as generating the lists of possible actions in situations where 11 as well as generating the lists of possible actions in situations where
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 for action in sorted(actions): 432 for action in sorted(actions):
433 if hash_output: 433 if hash_output:
434 hash = hashlib.md5() 434 hash = hashlib.md5()
435 hash.update(action) 435 hash.update(action)
436 print >>f, '0x%s\t%s' % (hash.hexdigest()[:16], action) 436 print >>f, '0x%s\t%s' % (hash.hexdigest()[:16], action)
437 else: 437 else:
438 print action 438 print action
439 439
440 if hash_output: 440 if hash_output:
441 print "Done. Do not forget to add chromeactions.txt to your changelist" 441 print "Done. Do not forget to add chromeactions.txt to your changelist"
442 return 0
443
442 444
443 if '__main__' == __name__: 445 if '__main__' == __name__:
444 main(sys.argv) 446 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « chrome/tools/check_grd_for_unused_strings.py ('k') | chrome/tools/extract_histograms.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698