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

Unified Diff: tools/dom/scripts/monitored.py

Issue 444743002: Use Blink IDL parser for dart libraries. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merged Created 6 years, 3 months 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
« no previous file with comments | « tools/dom/scripts/idlnode_test.py ('k') | tools/dom/scripts/multiemitter.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/monitored.py
diff --git a/tools/dom/scripts/monitored.py b/tools/dom/scripts/monitored.py
index 5d180c96964e2b9a97bc855fb0d2592b657114ed..d8316cf660b03b2d9bcebdf1fbf78790b3744320 100644
--- a/tools/dom/scripts/monitored.py
+++ b/tools/dom/scripts/monitored.py
@@ -3,16 +3,17 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
+
"""This module provides maps and sets that report unused elements."""
_monitored_values = []
-def FinishMonitoring(includeDart2jsOnly):
+def FinishMonitoring(includeDart2jsOnly, logger):
for value in _monitored_values:
if value._dart2jsOnly and not includeDart2jsOnly:
continue
- value.CheckUsage()
+ value.CheckUsage(logger)
class MonitoredCollection(object):
def __init__(self, name, dart2jsOnly):
@@ -49,10 +50,10 @@ class Dict(MonitoredCollection):
def keys(self):
return self._map.keys()
- def CheckUsage(self):
+ def CheckUsage(self, logger):
for v in sorted(self._map.keys()):
if v not in self._used_keys:
- print "dict '%s' has unused key '%s'" % (self.name, v)
+ logger.warn('dict \'%s\' has unused key \'%s\'' % (self.name, v))
class Set(MonitoredCollection):
@@ -72,7 +73,7 @@ class Set(MonitoredCollection):
def add(self, key):
self._set += [key]
- def CheckUsage(self):
+ def CheckUsage(self, logger):
for v in sorted(self._set):
if v not in self._used_keys:
- print "set '%s' has unused key '%s'" % (self.name, v)
+ logger.warn('set \'%s\' has unused key \'%s\'' % (self.name, v))
« no previous file with comments | « tools/dom/scripts/idlnode_test.py ('k') | tools/dom/scripts/multiemitter.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698