Skip to content

Commit

Permalink
adodbapi: Remove redundant object subclassing (#2086)
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Apr 9, 2024
1 parent 5b8d7d1 commit 50436c4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions adodbapi/adodbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,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 @@ -525,7 +525,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 @@ -156,7 +156,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 @@ -381,7 +381,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 @@ -553,7 +553,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 @@ -629,7 +629,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 @@ -184,7 +184,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 @@ -383,7 +383,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 @@ -132,7 +132,7 @@ def unfixpickle(x):
return newargs


class ServerConnection(object):
class ServerConnection:
def __init__(self):
self.server_connection = None
self.cursors = {}
Expand Down Expand Up @@ -311,14 +311,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 @@ -1654,7 +1654,7 @@ def testTimestamp(self):
suites.append(unittest.makeSuite(TestADOwithPostgres, "test"))


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

Expand Down

0 comments on commit 50436c4

Please sign in to comment.