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

Public Member Functions

def __init__ (self, name, map, dart2jsOnly=False)
 
def __getitem__ (self, key)
 
def __setitem__ (self, key, value)
 
def __contains__ (self, key)
 
def __iter__ (self)
 
def get (self, key, default=None)
 
def keys (self)
 
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 dict that reports unused keys.

Definition at line 26 of file monitored.py.

Constructor & Destructor Documentation

◆ __init__()

def scripts.monitored.Dict.__init__ (   self,
  name,
  map,
  dart2jsOnly = False 
)

Reimplemented from scripts.monitored.MonitoredCollection.

Definition at line 29 of file monitored.py.

29 def __init__(self, name, map, dart2jsOnly=False):
30 super(Dict, self).__init__(name, dart2jsOnly)
31 self._map = map
32

Member Function Documentation

◆ __contains__()

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

Definition at line 40 of file monitored.py.

40 def __contains__(self, key):
41 self._used_keys.add(key)
42 return key in self._map
43

◆ __getitem__()

def scripts.monitored.Dict.__getitem__ (   self,
  key 
)

Definition at line 33 of file monitored.py.

33 def __getitem__(self, key):
34 self._used_keys.add(key)
35 return self._map[key]
36

◆ __iter__()

def scripts.monitored.Dict.__iter__ (   self)

Definition at line 44 of file monitored.py.

44 def __iter__(self):
45 return self._map.__iter__()
46

◆ __setitem__()

def scripts.monitored.Dict.__setitem__ (   self,
  key,
  value 
)

Definition at line 37 of file monitored.py.

37 def __setitem__(self, key, value):
38 self._map[key] = value
39

◆ CheckUsage()

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

Definition at line 54 of file monitored.py.

54 def CheckUsage(self, logger):
55 for v in sorted(self._map.keys()):
56 if v not in self._used_keys:
57 logger.warn(
58 'dict \'%s\' has unused key \'%s\'' % (self.name, v))
59
60

◆ get()

def scripts.monitored.Dict.get (   self,
  key,
  default = None 
)

Definition at line 47 of file monitored.py.

47 def get(self, key, default=None):
48 self._used_keys.add(key)
49 return self._map.get(key, default)
50
const myers::Point & get(const myers::Segment &)

◆ keys()

def scripts.monitored.Dict.keys (   self)

Definition at line 51 of file monitored.py.

51 def keys(self):
52 return self._map.keys()
53

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