Index: tools/dom/scripts/monitored.py |
diff --git a/tools/dom/scripts/monitored.py b/tools/dom/scripts/monitored.py |
index e90330ae7c6ae66cfe2c727af35871efbfb1cd1f..06dc4dd2da9b5b0b3fd77919dedf4937336bf7ca 100644 |
--- a/tools/dom/scripts/monitored.py |
+++ b/tools/dom/scripts/monitored.py |
@@ -19,7 +19,7 @@ class MonitoredCollection(object): |
_monitored_values.append(self) |
class Dict(MonitoredCollection): |
- """Wrapper for a read-only dict that reports unused keys.""" |
+ """Wrapper for a dict that reports unused keys.""" |
def __init__(self, name, map): |
super(Dict, self).__init__(name) |
@@ -50,7 +50,7 @@ class Dict(MonitoredCollection): |
class Set(MonitoredCollection): |
- """Wrapper for a read-only set that reports unused keys.""" |
+ """Wrapper for a set that reports unused keys.""" |
def __init__(self, name, a_set): |
super(Set, self).__init__(name) |
@@ -60,6 +60,12 @@ class Set(MonitoredCollection): |
self._used_keys.add(key) |
return key in self._set |
+ def __iter__(self): |
+ return self._set.__iter__() |
+ |
+ def add(self, key): |
+ self._set += [key] |
+ |
def CheckUsage(self): |
for v in sorted(self._set): |
if v not in self._used_keys: |