OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 'ia', 'id', 'is', 'it', 'it-CH', 'it-IT', 'ja', 'jw', 'ka', 'kk', 'km', | 69 'ia', 'id', 'is', 'it', 'it-CH', 'it-IT', 'ja', 'jw', 'ka', 'kk', 'km', |
70 'kn', 'ko', 'ku', 'ky', 'la', 'ln', 'lo', 'lt', 'lv', 'mk', 'ml', 'mn', | 70 'kn', 'ko', 'ku', 'ky', 'la', 'ln', 'lo', 'lt', 'lv', 'mk', 'ml', 'mn', |
71 'mo', 'mr', 'ms', 'mt', 'nb', 'ne', 'nl', 'nn', 'no', 'oc', 'om', 'or', | 71 'mo', 'mr', 'ms', 'mt', 'nb', 'ne', 'nl', 'nn', 'no', 'oc', 'om', 'or', |
72 'pa', 'pl', 'ps', 'pt', 'pt-BR', 'pt-PT', 'qu', 'rm', 'ro', 'ru', 'sd', | 72 'pa', 'pl', 'ps', 'pt', 'pt-BR', 'pt-PT', 'qu', 'rm', 'ro', 'ru', 'sd', |
73 'sh', 'si', 'sk', 'sl', 'sn', 'so', 'sq', 'sr', 'st', 'su', 'sv', 'sw', | 73 'sh', 'si', 'sk', 'sl', 'sn', 'so', 'sq', 'sr', 'st', 'su', 'sv', 'sw', |
74 'ta', 'te', 'tg', 'th', 'ti', 'tk', 'to', 'tr', 'tt', 'tw', 'ug', 'uk', | 74 'ta', 'te', 'tg', 'th', 'ti', 'tk', 'to', 'tr', 'tt', 'tw', 'ug', 'uk', |
75 'ur', 'uz', 'vi', 'xh', 'yi', 'yo', 'zh', 'zh-CN', 'zh-TW', 'zu', | 75 'ur', 'uz', 'vi', 'xh', 'yi', 'yo', 'zh', 'zh-CN', 'zh-TW', 'zu', |
76 ) | 76 ) |
77 | 77 |
78 # Input method IDs used in Chrome OS. The list should be updated when a | 78 # Input method IDs used in Chrome OS. The list should be updated when a |
79 # new input method is added to platform/assets/input_methods/whitelist.txt | 79 # new input method is added to |
80 # in the Chrome OS tree, as follows: | 80 # chrome/browser/chromeos/input_method/input_methods.txt in the Chrome tree, as |
| 81 # follows: |
81 # | 82 # |
82 # % sort chromeos/src/platform/assets/input_methods/whitelist.txt | \ | 83 # % sort chrome/browser/chromeos/input_method/input_methods.txt | \ |
83 # perl -ne "print \"'\$1', \" if /^([^#]+?)\s/" | \ | 84 # perl -ne "print \"'\$1', \" if /^([^#]+?)\s/" | \ |
84 # fold -w75 -s | perl -pe 's/^/ /;s/ $//'; echo | 85 # fold -w75 -s | perl -pe 's/^/ /;s/ $//'; echo |
85 # | 86 # |
86 # The script extracts input method IDs from whitelist.txt. | 87 # The script extracts input method IDs from input_methods.txt. |
87 INPUT_METHOD_IDS = ( | 88 INPUT_METHOD_IDS = ( |
88 'chewing', 'hangul', 'm17n:ar:kbd', 'm17n:fa:isiri', 'm17n:hi:itrans', | 89 'english-m', 'm17n:am:sera', 'm17n:ar:kbd', 'm17n:bn:itrans', |
89 'm17n:th:kesmanee', 'm17n:th:pattachote', 'm17n:th:tis820', | 90 'm17n:fa:isiri', 'm17n:gu:itrans', 'm17n:hi:itrans', 'm17n:kn:itrans', |
90 'm17n:vi:tcvn', 'm17n:vi:telex', 'm17n:vi:viqr', 'm17n:vi:vni', | 91 'm17n:ml:itrans', 'm17n:mr:itrans', 'm17n:ta:inscript', 'm17n:ta:itrans', |
91 'm17n:zh:cangjie', 'm17n:zh:quick', 'mozc', 'mozc-dv', 'mozc-jp', | 92 'm17n:ta:phonetic', 'm17n:ta:tamil99', 'm17n:ta:typewriter', |
92 'pinyin', 'xkb:be::fra', 'xkb:be::ger', 'xkb:be::nld', 'xkb:bg::bul', | 93 'm17n:te:itrans', 'm17n:th:kesmanee', 'm17n:th:pattachote', |
93 'xkb:bg:phonetic:bul', 'xkb:br::por', 'xkb:ca::fra', 'xkb:ca:eng:eng', | 94 'm17n:th:tis820', 'm17n:vi:tcvn', 'm17n:vi:telex', 'm17n:vi:viqr', |
94 'xkb:ch::ger', 'xkb:ch:fr:fra', 'xkb:cz::cze', 'xkb:de::ger', | 95 'm17n:vi:vni', 'm17n:zh:cangjie', 'm17n:zh:quick', 'mozc', 'mozc-chewing', |
| 96 'mozc-dv', 'mozc-hangul', 'mozc-jp', 'pinyin', 'pinyin-dv', 'xkb:be::fra', |
| 97 'xkb:be::ger', 'xkb:be::nld', 'xkb:bg::bul', 'xkb:bg:phonetic:bul', |
| 98 'xkb:br::por', 'xkb:ca::fra', 'xkb:ca:eng:eng', 'xkb:ch::ger', |
| 99 'xkb:ch:fr:fra', 'xkb:cz::cze', 'xkb:de::ger', 'xkb:de:neo:ger', |
95 'xkb:dk::dan', 'xkb:ee::est', 'xkb:es::spa', 'xkb:es:cat:cat', | 100 'xkb:dk::dan', 'xkb:ee::est', 'xkb:es::spa', 'xkb:es:cat:cat', |
96 'xkb:fi::fin', 'xkb:fr::fra', 'xkb:gb:extd:eng', 'xkb:gr::gre', | 101 'xkb:fi::fin', 'xkb:fr::fra', 'xkb:gb:dvorak:eng', 'xkb:gb:extd:eng', |
97 'xkb:hr::scr', 'xkb:hu::hun', 'xkb:il::heb', 'xkb:it::ita', 'xkb:jp::jpn', | 102 'xkb:gr::gre', 'xkb:hr::scr', 'xkb:hu::hun', 'xkb:il::heb', 'xkb:it::ita', |
98 'xkb:kr:kr104:kor', 'xkb:lt::lit', 'xkb:lv::lav', 'xkb:nl::nld', | 103 'xkb:jp::jpn', 'xkb:kr:kr104:kor', 'xkb:latam::spa', 'xkb:lt::lit', |
99 'xkb:no::nor', 'xkb:pl::pol', 'xkb:pt::por', 'xkb:ro::rum', 'xkb:rs::srp', | 104 'xkb:lv:apostrophe:lav', 'xkb:no::nob', 'xkb:pl::pol', 'xkb:pt::por', |
100 'xkb:ru::rus', 'xkb:ru:phonetic:rus', 'xkb:se::swe', 'xkb:si::slv', | 105 'xkb:ro::rum', 'xkb:rs::srp', 'xkb:ru::rus', 'xkb:ru:phonetic:rus', |
101 'xkb:sk::slo', 'xkb:tr::tur', 'xkb:ua::ukr', 'xkb:us::eng', | 106 'xkb:se::swe', 'xkb:si::slv', 'xkb:sk::slo', 'xkb:tr::tur', 'xkb:ua::ukr', |
102 'xkb:us:altgr-intl:eng', 'xkb:us:dvorak:eng', | 107 'xkb:us::eng', 'xkb:us:altgr-intl:eng', 'xkb:us:colemak:eng', |
| 108 'xkb:us:dvorak:eng', 'xkb:us:intl:eng', |
103 ) | 109 ) |
104 | 110 |
105 number_of_files_total = 0 | 111 number_of_files_total = 0 |
106 | 112 |
107 | 113 |
108 def AddComputedActions(actions): | 114 def AddComputedActions(actions): |
109 """Add computed actions to the actions list. | 115 """Add computed actions to the actions list. |
110 | 116 |
111 Arguments: | 117 Arguments: |
112 actions: set of actions to add to. | 118 actions: set of actions to add to. |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 else: | 442 else: |
437 print action | 443 print action |
438 | 444 |
439 if hash_output: | 445 if hash_output: |
440 print "Done. Do not forget to add chromeactions.txt to your changelist" | 446 print "Done. Do not forget to add chromeactions.txt to your changelist" |
441 return 0 | 447 return 0 |
442 | 448 |
443 | 449 |
444 if '__main__' == __name__: | 450 if '__main__' == __name__: |
445 sys.exit(main(sys.argv)) | 451 sys.exit(main(sys.argv)) |
OLD | NEW |