Exemplo n.º 1
0
Arquivo: data.py Projeto: caomw/grass
 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
Exemplo n.º 2
0
 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