Skip to content
Permalink
Browse files

Use python super() calls

  • Loading branch information
pblottiere committed Mar 2, 2018
1 parent 6a49e57 commit 887a226115b6e36fa9308c113edf19611b37102f
@@ -153,7 +153,7 @@ class SqlResultModelAsync(QObject):
done = pyqtSignal()

def __init__(self):
QObject.__init__(self)
super().__init__()
self.error = BaseError('')
self.status = None
self.model = None
@@ -177,7 +177,7 @@ def modelDone(self):
class SqlResultModelTask(QgsTask):

def __init__(self, db, sql, parent):
QgsTask.__init__(self)
super().__init__()
self.db = db
self.sql = sql
self.parent = parent
@@ -211,7 +211,7 @@ def __init__(self, db, sql, parent=None):
data = []
header = []

BaseTableModel.__init__(self, header, data, parent)
super().__init__(header, data, parent)

# commit before closing the cursor to make sure that the changes are stored
self.db._commit()
@@ -56,7 +56,7 @@ def rowCount(self, index=None):
class GPKGSqlResultModelTask(SqlResultModelTask):

def __init__(self, db, sql, parent):
SqlResultModelTask.__init__(self, db, sql, parent)
super().__init__(db, sql, parent)

def run(self):
try:
@@ -75,7 +75,7 @@ def cancel(self):
class GPKGSqlResultModelAsync(SqlResultModelAsync):

def __init__(self, db, sql, parent):
SqlResultModelAsync.__init__(self)
super().__init__()

self.task = GPKGSqlResultModelTask(db, sql, parent)
self.task.taskCompleted.connect(self.modelDone)
@@ -86,7 +86,7 @@ def fetchMoreData(self, row_start):
class PGSqlResultModelTask(SqlResultModelTask):

def __init__(self, db, sql, parent):
SqlResultModelTask.__init__(self, db, sql, parent)
super().__init__(db, sql, parent)

def run(self):
try:
@@ -105,7 +105,7 @@ def cancel(self):
class PGSqlResultModelAsync(SqlResultModelAsync):

def __init__(self, db, sql, parent):
SqlResultModelAsync.__init__(self)
super().__init__()

self.task = PGSqlResultModelTask(db, sql, parent)
self.task.taskCompleted.connect(self.modelDone)
@@ -69,7 +69,7 @@ def rowCount(self, index=None):
class SLSqlResultModelTask(SqlResultModelTask):

def __init__(self, db, sql, parent):
SqlResultModelTask.__init__(self, db, sql, parent)
super().__init__(db, sql, parent)
self.clone = None

def run(self):
@@ -96,7 +96,7 @@ def cancel(self):
class SLSqlResultModelAsync(SqlResultModelAsync):

def __init__(self, db, sql, parent):
SqlResultModelAsync.__init__(self)
super().__init__()

self.task = SLSqlResultModelTask(db, sql, parent)
self.task.taskCompleted.connect(self.modelDone)
@@ -73,7 +73,7 @@ def rowCount(self, index=None):
class LSqlResultModelTask(SqlResultModelTask):

def __init__(self, db, sql, parent):
SqlResultModelTask.__init__(self, db, sql, parent)
super().__init__(db, sql, parent)

tf = QTemporaryFile()
tf.open()
@@ -105,7 +105,7 @@ def cancel(self):
class LSqlResultModelAsync(SqlResultModelAsync):

def __init__(self, db, sql, parent=None):
SqlResultModelAsync.__init__(self)
super().__init__()

self.task = LSqlResultModelTask(db, sql, parent)
self.task.taskCompleted.connect(self.modelDone)

0 comments on commit 887a226

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