

def _buildMetadata(self, parse_remote_metadata=False):
    ' set up capabilities metadata objects '
    if self._capabilities.attrib.get('version'):
        self.version = self._capabilities.attrib.get('version')
    self.identification = ServiceIdentification(self._capabilities, self.version)
    self.contents = {
        
    }
    tilemaps = self._capabilities.find('TileMaps')
    if (tilemaps is not None):
        for tilemap in tilemaps.findall('TileMap'):
            cm = ContentMetadata(tilemap, un=self.username, pw=self.password)
            if cm.id:
                if (cm.id in cm.contents):
                    raise KeyError(('Content metadata for layer "%s" already exists' % cm.id))
                self.contents[cm.id] = cm

dataset/ETHPy150Open geopython/OWSLib/owslib/tms.py TileMapService._buildMetadata/VarMisuse@135/182 `self`->`cm`