def SetName(self, name): if not self.hidden: if self._mapType is None: raise ValueError("To set layer name, the type of layer must be specified.") if self._mapType in ('strds', 'stvds', 'str3ds'): try: name = validateTimeseriesName(name, self._mapType) self._maps = getRegisteredMaps(name, self._mapType) except (GException, gcore.ScriptError) as e: raise ValueError(str(e)) else: self._maps = validateMapNames(name.split(','), self._mapType) self._name = name self.label = name
def SetName(self, name): if not self.hidden: if self._mapType is None: raise ValueError( "To set layer name, the type of layer must be specified.") if self._mapType in ('strds', 'stvds', 'str3ds'): try: name = validateTimeseriesName(name, self._mapType) self._maps = getRegisteredMaps(name, self._mapType) except (GException, gcore.ScriptError) as e: raise ValueError(str(e)) else: self._maps = validateMapNames(name.split(','), self._mapType) self._name = name self.label = name