mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
replace foo.replace( QRegExp(regexp), bar) with re.sub(regexp,bar,foo) (fixes #8066)
This commit is contained in:
parent
b98e1e05cb
commit
192e13013b
@ -33,6 +33,7 @@ from widgetBatchBase import GdalToolsBaseBatchWidget as BaseBatchWidget
|
||||
import GdalTools_utils as Utils
|
||||
|
||||
import os.path
|
||||
import re
|
||||
|
||||
class GdalToolsDialog( QWidget, Ui_Widget, BaseBatchWidget ):
|
||||
def __init__( self, iface ):
|
||||
@ -228,7 +229,7 @@ class GdalToolsDialog( QWidget, Ui_Widget, BaseBatchWidget ):
|
||||
for f in files:
|
||||
self.inFiles.append( inDir + "/" + f )
|
||||
if outDir != None:
|
||||
outFile = f.replace( QRegExp( "\.[a-zA-Z0-9]{2,4}" ), outExt )
|
||||
outFile = re.sub( f, "\.[a-zA-Z0-9]{2,4}", outExt )
|
||||
self.outFiles.append( outDir + "/" + outFile )
|
||||
|
||||
self.errors = QStringList()
|
||||
|
@ -33,6 +33,8 @@ from widgetBatchBase import GdalToolsBaseBatchWidget as BaseBatchWidget
|
||||
from dialogSRS import GdalToolsSRSDialog as SRSDialog
|
||||
import GdalTools_utils as Utils
|
||||
|
||||
import re
|
||||
|
||||
class GdalToolsDialog(QWidget, Ui_Widget, BaseBatchWidget):
|
||||
|
||||
def __init__(self, iface):
|
||||
@ -298,7 +300,7 @@ class GdalToolsDialog(QWidget, Ui_Widget, BaseBatchWidget):
|
||||
for f in files:
|
||||
self.inFiles.append( inDir + "/" + f )
|
||||
if outDir != None:
|
||||
outFile = f.replace( QRegExp( "\.[a-zA-Z0-9]{2,4}" ), outExt )
|
||||
outFile = re.sub( "\.[a-zA-Z0-9]{2,4}", outExt, f )
|
||||
self.outFiles.append( outDir + "/" + outFile )
|
||||
|
||||
self.errors = QStringList()
|
||||
|
@ -34,6 +34,8 @@ from .ui.ui_DlgSqlWindow import Ui_DbManagerDlgSqlWindow as Ui_Dialog
|
||||
from .highlighter import SqlHighlighter
|
||||
from .completer import SqlCompleter
|
||||
|
||||
import re
|
||||
|
||||
class DlgSqlWindow(QDialog, Ui_Dialog):
|
||||
|
||||
def __init__(self, iface, db, parent=None):
|
||||
@ -134,7 +136,7 @@ class DlgSqlWindow(QDialog, Ui_Dialog):
|
||||
if sql == "":
|
||||
sql = self.editSql.toPlainText()
|
||||
# try to sanitize query
|
||||
sql = sql.replace( QRegExp( ";\\s*$" ), "" )
|
||||
sql = re.sub( ";\\s*$", "", sql )
|
||||
return sql
|
||||
|
||||
def clearSql(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user