Skip to content
Permalink
Browse files

Improved implementation

  • Loading branch information
ccrook authored and m-kuhn committed Jun 15, 2013
1 parent d416555 commit 54956db92f70b846d518fe5a90f9b45037bf56fd
Showing with 4 additions and 6 deletions.
  1. +1 −1 python/plugins/fTools/tools/doPointDistance.py
  2. +3 −5 python/plugins/fTools/tools/ftools_utils.py
@@ -128,7 +128,7 @@ def accept(self):
else: matType = "Summary"
if self.chkNearest.isChecked(): nearest = self.spnNearest.value()
else: nearest = 0
outName = ftools_utils.getShapefileName(outPath)
outName = ftools_utils.getShapefileName(outPath,'.csv')
self.outFile.clear()
self.compute(point1, point2, field1, field2, outPath, matType, nearest, self.progressBar)
self.progressBar.setValue(100)
@@ -383,12 +383,10 @@ def getShapesByGeometryType( baseDir, inShapes, geomType ):

return outShapes

def getShapefileName( outPath ):
def getShapefileName( outPath, extension='.shp' ):
import os.path
outName=os.path.basename(outPath)
if outName.endswith('.shp'):
outName=outName[:-4]
if outName.endswith('.csv'):
outName=outName[:-4]
if outName.endswith(extension):
outName=outName[:-len(extension)]
return outName

0 comments on commit 54956db

Please sign in to comment.
You can’t perform that action at this time.