gdaltools: more SIP APIv2 update

This commit is contained in:
Giuseppe Sucameli 2013-06-27 22:52:17 +02:00
parent edd0cdd294
commit df4fc99e83
2 changed files with 5 additions and 5 deletions

View File

@ -205,7 +205,7 @@ class GdalToolsDialog( QWidget, Ui_Widget, BaseBatchWidget ):
self.progressBar.setValue( 0 ) self.progressBar.setValue( 0 )
def batchRun(self): def batchRun(self):
exts = self.formatCombo.currentText().remove( QRegExp('^.*\(') ).remove( QRegExp('\).*$') ).split( " " ) exts = re.sub('\).*$', '', re.sub('^.*\(', '', self.formatCombo.currentText())).split(" ")
if exts and exts != "*" and exts != "*.*": if exts and exts != "*" and exts != "*.*":
outExt = exts[ 0 ].remove( "*" ) outExt = exts[ 0 ].remove( "*" )
else: else:
@ -229,7 +229,7 @@ class GdalToolsDialog( QWidget, Ui_Widget, BaseBatchWidget ):
for f in files: for f in files:
self.inFiles.append( inDir + "/" + f ) self.inFiles.append( inDir + "/" + f )
if outDir != None: if outDir != None:
outFile = re.sub( f, "\.[a-zA-Z0-9]{2,4}", outExt ) outFile = re.sub( "\.[a-zA-Z0-9]{2,4}", outExt, f )
self.outFiles.append( outDir + "/" + outFile ) self.outFiles.append( outDir + "/" + outFile )
self.errors = [] self.errors = []

View File

@ -206,7 +206,7 @@ class GdalToolsDialog(QWidget, Ui_Widget, BaseBatchWidget):
if self.sdsCheck.isChecked(): if self.sdsCheck.isChecked():
arguments.append( "-sds") arguments.append( "-sds")
if self.srcwinCheck.isChecked() and self.srcwinEdit.text(): if self.srcwinCheck.isChecked() and self.srcwinEdit.text():
coordList = self.srcwinEdit.text().split( ' ', QString.SkipEmptyParts ) coordList = self.srcwinEdit.text().split() # split the string on whitespace(s)
if len(coordList) == 4 and coordList[3]: if len(coordList) == 4 and coordList[3]:
try: try:
for x in coordList: for x in coordList:
@ -219,7 +219,7 @@ class GdalToolsDialog(QWidget, Ui_Widget, BaseBatchWidget):
for x in coordList: for x in coordList:
arguments.append( x) arguments.append( x)
if self.prjwinCheck.isChecked() and self.prjwinEdit.text(): if self.prjwinCheck.isChecked() and self.prjwinEdit.text():
coordList = self.prjwinEdit.text().split( ' ', QString.SkipEmptyParts ) coordList = self.prjwinEdit.text().split() # split the string on whitespace(s)
if len(coordList) == 4 and coordList[3]: if len(coordList) == 4 and coordList[3]:
try: try:
for x in coordList: for x in coordList:
@ -276,7 +276,7 @@ class GdalToolsDialog(QWidget, Ui_Widget, BaseBatchWidget):
self.progressBar.setValue( 0 ) self.progressBar.setValue( 0 )
def batchRun(self): def batchRun(self):
exts = self.formatCombo.currentText().remove( QRegExp('^.*\(') ).remove( QRegExp('\).*$') ).split( " " ) exts = re.sub('\).*$', '', re.sub('^.*\(', '', self.formatCombo.currentText())).split(" ")
if exts and exts != "*" and exts != "*.*": if exts and exts != "*" and exts != "*.*":
outExt = exts[ 0 ].remove( "*" ) outExt = exts[ 0 ].remove( "*" )
else: else: