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

Unified Diff: chrome/tools/extract_actions.py

Issue 8919017: Split UserMetrics into API vs. implementation. Move API to content/public. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Version for commit (merged again). 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 side-by-side diff with in-line comments
Download patch
Index: chrome/tools/extract_actions.py
diff --git a/chrome/tools/extract_actions.py b/chrome/tools/extract_actions.py
index 3f1db644504b0ff24abe27f91855bb042ff310ef..8d4cf62757fabe44ebf13de2e9fa3c28251f35d5 100755
--- a/chrome/tools/extract_actions.py
+++ b/chrome/tools/extract_actions.py
@@ -29,7 +29,7 @@ import sys
sys.path.insert(1, os.path.join(sys.path[0], '..', '..', 'tools', 'python'))
from google import path_utils
-# Files that are known to use UserMetrics::RecordComputedAction(), which means
+# Files that are known to use content::RecordComputedAction(), which means
# they require special handling code in this script.
# To add a new file, add it to this list and add the appropriate logic to
# generate the known actions to AddComputedActions() below.
@@ -247,7 +247,7 @@ def GrepForActions(path, actions):
# this should be on one line
action_re = re.compile(r'[^a-zA-Z]UserMetricsAction\("([^"]*)')
malformed_action_re = re.compile(r'[^a-zA-Z]UserMetricsAction\([^"]')
- computed_action_re = re.compile(r'UserMetrics::RecordComputedAction')
+ computed_action_re = re.compile(r'RecordComputedAction')
line_number = 0
for line in open(path):
line_number = line_number + 1
@@ -311,14 +311,21 @@ def GrepForWebUIActions(path, actions):
path: path to the file
actions: set of actions to add to
"""
- parser = WebUIActionsParser(actions)
- parser.feed(open(path).read())
- parser.close()
+ try:
+ parser = WebUIActionsParser(actions)
+ parser.feed(open(path).read())
+ except Exception, e:
+ print "Error encountered for path %s" % path
+ raise e
+ finally:
+ parser.close()
def WalkDirectory(root_path, actions, extensions, callback):
for path, dirs, files in os.walk(root_path):
if '.svn' in dirs:
dirs.remove('.svn')
+ if '.git' in dirs:
+ dirs.remove('.git')
for file in files:
ext = os.path.splitext(file)[1]
if ext in extensions:
« no previous file with comments | « chrome/browser/web_resource/web_resource_service.cc ('k') | content/browser/appcache/appcache_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698