Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adodbapi: Remove redundant object subclassing #2086

Merged
merged 3 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions adodbapi/adodbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def _configure_parameter(p, value, adotype, settings_known):


# # # # # ----- the Class that defines a connection ----- # # # # #
class Connection(object):
class Connection:
# include connection attributes as class attributes required by api definition.
Warning = api.Warning
Error = api.Error
Expand Down Expand Up @@ -565,7 +565,7 @@ def get_table_names(self):


# # # # # ----- the Class that defines a cursor ----- # # # # #
class Cursor(object):
class Cursor:
## ** api required attributes:
## description...
## This read-only attribute is a sequence of 7-item sequences.
Expand Down
8 changes: 4 additions & 4 deletions adodbapi/apibase.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class FetchFailedError(OperationalError):
# b = makeByteBuffer(aString)
# return b
# ----- Time converters ----------------------------------------------
class TimeConverter(object): # this is a generic time converter skeleton
class TimeConverter: # this is a generic time converter skeleton
def __init__(self): # the details will be filled in by instances
self._ordinal_1899_12_31 = datetime.date(1899, 12, 31).toordinal() - 1
# Use cls.types to compare if an input parameter is a datetime
Expand Down Expand Up @@ -395,7 +395,7 @@ def Timestamp(self, year, month, day, hour, minute, second):


# this class is a trick to determine whether a type is a member of a related group of types. see PEP notes
class DBAPITypeObject(object):
class DBAPITypeObject:
def __init__(self, valuesTuple):
self.values = frozenset(valuesTuple)

Expand Down Expand Up @@ -578,7 +578,7 @@ def __setitem__(self, adoType, cvtFn):
RS_WIN_32, RS_ARRAY, RS_REMOTE = list(range(1, 4))


class SQLrow(object): # a single database row
class SQLrow: # a single database row
# class to emulate a sequence, so that a column may be retrieved by either number or name
def __init__(self, rows, index): # "rows" is an _SQLrows object, index is which row
self.rows = rows # parent 'fetch' container object
Expand Down Expand Up @@ -654,7 +654,7 @@ def __str__(self): # create a pretty human readable representation
# # # #


class SQLrows(object):
class SQLrows:
# class to emulate a sequence for multiple rows using a container object
def __init__(self, ado_results, numberOfRows, cursor):
self.ado_results = ado_results # raw result of SQL get
Expand Down
4 changes: 2 additions & 2 deletions adodbapi/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def fix_uri(uri, kwargs):


# # # # # ----- the Class that defines a connection ----- # # # # #
class Connection(object):
class Connection:
# include connection attributes required by api definition.
Warning = api.Warning
Error = api.Error
Expand Down Expand Up @@ -387,7 +387,7 @@ def fixpickle(x):
return newargs


class Cursor(object):
class Cursor:
def __init__(self, connection):
self.command = None
self.errorhandler = None ## was: connection.errorhandler
Expand Down
6 changes: 3 additions & 3 deletions adodbapi/remote/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def unfixpickle(x):
return newargs


class ServerConnection(object):
class ServerConnection:
def __init__(self):
self.server_connection = None
self.cursors = {}
Expand Down Expand Up @@ -312,14 +312,14 @@ def suicide(self):
print("Shutdown request received")


class ConnectionDispatcher(object):
class ConnectionDispatcher:
def make_connection(self):
new_connection = ServerConnection()
pyro_uri = self._pyroDaemon.register(new_connection)
return pyro_uri


class Heartbeat_Timer(object):
class Heartbeat_Timer:
def __init__(self, interval, work_function, tick_result_function):
self.interval = interval
self.last_tick = datetime.datetime.now()
Expand Down
2 changes: 1 addition & 1 deletion adodbapi/test/adodbapitest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1663,7 +1663,7 @@ def testTimestamp(self):
suites.append(unittest.makeSuite(TestADOwithPostgres, "test"))


class cleanup_manager(object):
class cleanup_manager:
def __enter__(self):
pass

Expand Down
Loading