Example #1
0
    def OnSetDsn(self, event):
        """Input DXF file defined, update list of layer widget"""
        path = event.GetString()
        if not path:
            return

        data = list()
        ret = RunCommand(
            "v.in.dxf", quiet=True, parent=self, read=True, flags="l", input=path
        )
        if not ret:
            self.list.LoadData()
            return

        for line in ret.splitlines():
            layerId = line.split(":")[0].split(" ")[1]
            layerName = line.split(":")[1].strip()
            grassName = GetValidLayerName(layerName)
            data.append((layerId, layerName.strip(), grassName.strip()))

        self.list.LoadData(data)
Example #2
0
 def OnSetDsn(self, event):
     """Input DXF file defined, update list of layer widget"""
     path = event.GetString()
     if not path:
         return 
     
     data = list()        
     ret = RunCommand('v.in.dxf',
                      quiet = True,
                      parent = self,
                      read = True,
                      flags = 'l',
                      input = path)
     if not ret:
         self.list.LoadData()
         return
         
     for line in ret.splitlines():
         layerId = line.split(':')[0].split(' ')[1]
         layerName = line.split(':')[1].strip()
         grassName = GetValidLayerName(layerName)
         data.append((layerId, layerName.strip(), grassName.strip()))
     
     self.list.LoadData(data)