Improved implementation

This commit is contained in:
Chris Crook 2013-06-14 19:58:04 +12:00 committed by Matthias Kuhn
parent d416555079
commit 54956db92f
2 changed files with 4 additions and 6 deletions

View File

@ -128,7 +128,7 @@ class Dialog(QDialog, Ui_Dialog):
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)

View File

@ -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