Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
scripts.monitored.Set Class Reference
Inheritance diagram for scripts.monitored.Set:
scripts.monitored.MonitoredCollection

Public Member Functions

def __init__ (self, name, a_set, dart2jsOnly=False)
 
def __contains__ (self, key)
 
def __iter__ (self)
 
def add (self, key)
 
def CheckUsage (self, logger)
 
def __init__ (self, name, dart2jsOnly)
 

Additional Inherited Members

- Public Attributes inherited from scripts.monitored.MonitoredCollection
 name
 

Detailed Description

Wrapper for a set that reports unused keys.

Definition at line 61 of file monitored.py.

Constructor & Destructor Documentation

◆ __init__()

def scripts.monitored.Set.__init__ (   self,
  name,
  a_set,
  dart2jsOnly = False 
)

Reimplemented from scripts.monitored.MonitoredCollection.

Definition at line 64 of file monitored.py.

64 def __init__(self, name, a_set, dart2jsOnly=False):
65 super(Set, self).__init__(name, dart2jsOnly)
66 self._set = a_set
67

Member Function Documentation

◆ __contains__()

def scripts.monitored.Set.__contains__ (   self,
  key 
)

Definition at line 68 of file monitored.py.

68 def __contains__(self, key):
69 self._used_keys.add(key)
70 return key in self._set
71

◆ __iter__()

def scripts.monitored.Set.__iter__ (   self)

Definition at line 72 of file monitored.py.

72 def __iter__(self):
73 return self._set.__iter__()
74

◆ add()

def scripts.monitored.Set.add (   self,
  key 
)

Definition at line 75 of file monitored.py.

75 def add(self, key):
76 self._set += [key]
77

◆ CheckUsage()

def scripts.monitored.Set.CheckUsage (   self,
  logger 
)

Definition at line 78 of file monitored.py.

78 def CheckUsage(self, logger):
79 for v in sorted(self._set):
80 if v not in self._used_keys:
81 logger.warn('set \'%s\' has unused key \'%s\'' % (self.name, v))

The documentation for this class was generated from the following file: