python 3 updates

- Fix super() calls for python 3
- No need to inherit objects.
- No need for u at the start of strings
- Tidied up some brackets and f-strings too
This commit is contained in:
Mark Mayo
2022-11-19 10:13:41 +05:30
committed by GitHub
parent 02362d8aa4
commit 41508f7f67
354 changed files with 532 additions and 534 deletions
+11 -11
View File
@@ -75,7 +75,7 @@ class ObjectRegistry(ABCMeta):
)
class BaseCommand(object, metaclass=ObjectRegistry):
class BaseCommand(metaclass=ObjectRegistry):
"""
class BaseCommand
@@ -125,7 +125,7 @@ class BaseCommand(object, metaclass=ObjectRegistry):
pass
class SQLFilter(object):
class SQLFilter():
"""
class SQLFilter
@@ -159,9 +159,9 @@ class SQLFilter(object):
**kwargs : N number of parameters
"""
# Save the server id and database id, namespace id, object id
assert ('sid' in kwargs)
assert ('did' in kwargs)
assert ('obj_id' in kwargs)
assert 'sid' in kwargs
assert 'did' in kwargs
assert 'obj_id' in kwargs
self.sid = kwargs['sid']
self.did = kwargs['did']
@@ -305,7 +305,7 @@ class SQLFilter(object):
return status, result
class FetchedRowTracker(object):
class FetchedRowTracker():
"""
Keeps track of fetched row count.
"""
@@ -322,7 +322,7 @@ class FetchedRowTracker(object):
class GridCommand(BaseCommand, SQLFilter, FetchedRowTracker):
"""
class GridCommand(object)
class GridCommand()
It is a base class for different object type used by data grid.
A different object type must implement this to expose abstract methods.
@@ -458,7 +458,7 @@ class TableCommand(GridCommand):
"""
# call base class init to fetch the table name
super(TableCommand, self).__init__(**kwargs)
super().__init__(**kwargs)
# Set the default sorting on table data by primary key if user
# preference value is set
@@ -703,7 +703,7 @@ class ViewCommand(GridCommand):
"""
# call base class init to fetch the table name
super(ViewCommand, self).__init__(**kwargs)
super().__init__(**kwargs)
def get_sql(self, default_conn=None):
"""
@@ -764,7 +764,7 @@ class ForeignTableCommand(GridCommand):
"""
# call base class init to fetch the table name
super(ForeignTableCommand, self).__init__(**kwargs)
super().__init__(**kwargs)
def get_sql(self, default_conn=None):
"""
@@ -815,7 +815,7 @@ class CatalogCommand(GridCommand):
"""
# call base class init to fetch the table name
super(CatalogCommand, self).__init__(**kwargs)
super().__init__(**kwargs)
def get_sql(self, default_conn=None):
"""