Skip to content

Commit

Permalink
Use python super() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Mar 2, 2018
1 parent 6a49e57 commit 887a226
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions python/plugins/db_manager/db_plugins/data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/db_manager/db_plugins/gpkg/data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/db_manager/db_plugins/postgis/data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/db_manager/db_plugins/spatialite/data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/db_manager/db_plugins/vlayers/data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 887a226

Please sign in to comment.