Skip to content
Permalink
Browse files

replace foo.replace( QRegExp(regexp), bar) with re.sub(regexp,bar,foo) (

fixes #8066)
  • Loading branch information
jef-n committed Jun 15, 2013
1 parent b98e1e0 commit 192e13013b24d8c3be3584555db11b9ab61dec37
@@ -33,6 +33,7 @@
import GdalTools_utils as Utils

import os.path
import re

class GdalToolsDialog( QWidget, Ui_Widget, BaseBatchWidget ):
def __init__( self, iface ):
@@ -228,7 +229,7 @@ def batchRun(self):
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 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 @@ def batchRun(self):
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 .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 @@ def getSql(self):
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):

0 comments on commit 192e130

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