Skip to content

Commit 61294f9

Browse files
authored
Remove use of object (#361)
1 parent 5efd421 commit 61294f9

File tree

12 files changed

+18
-17
lines changed

12 files changed

+18
-17
lines changed

canopen/emcy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
logger = logging.getLogger(__name__)
1111

1212

13-
class EmcyConsumer(object):
13+
class EmcyConsumer:
1414

1515
def __init__(self):
1616
#: Log of all received EMCYs for this node
@@ -79,7 +79,7 @@ def wait(
7979
return emcy
8080

8181

82-
class EmcyProducer(object):
82+
class EmcyProducer:
8383

8484
def __init__(self, cob_id: int):
8585
self.network = None

canopen/lss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
]
6666

6767

68-
class LssMaster(object):
68+
class LssMaster:
6969
"""The Master of Layer Setting Services"""
7070

7171
LSS_TX_COBID = 0x7E5

canopen/network.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
except ImportError:
1414
# Do not fail if python-can is not installed
1515
can = None
16-
Listener = object
1716
CanError = Exception
17+
class Listener:
18+
""" Dummy listener """
1819

1920
from .node import RemoteNode, LocalNode
2021
from .sync import SyncProducer
@@ -282,7 +283,7 @@ def __len__(self) -> int:
282283
return len(self.nodes)
283284

284285

285-
class PeriodicMessageTask(object):
286+
class PeriodicMessageTask:
286287
"""
287288
Task object to transmit a message periodically using python-can's
288289
CyclicSendTask
@@ -359,7 +360,7 @@ def on_message_received(self, msg):
359360
logger.error(str(e))
360361

361362

362-
class NodeScanner(object):
363+
class NodeScanner:
363364
"""Observes which nodes are present on the bus.
364365
365366
Listens for the following messages:

canopen/nmt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
}
4040

4141

42-
class NmtBase(object):
42+
class NmtBase:
4343
"""
4444
Can set the state of the node it controls using NMT commands and monitor
4545
the current state using the heartbeat protocol.

canopen/node/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from .. import objectdictionary
33

44

5-
class BaseNode(object):
5+
class BaseNode:
66
"""A CANopen node.
77
88
:param node_id:

canopen/objectdictionary/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def add_member(self, variable: "Variable") -> None:
266266
self.names[variable.name] = variable
267267

268268

269-
class Variable(object):
269+
class Variable:
270270
"""Simple variable."""
271271

272272
STRUCT_TYPES = {

canopen/pdo/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def __len__(self) -> int:
156156
return len(self.maps)
157157

158158

159-
class Map(object):
159+
class Map:
160160
"""One message which can have up to 8 bytes of variables mapped."""
161161

162162
def __init__(self, pdo_node, com_record, map_array):

canopen/profiles/p402.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
logger = logging.getLogger(__name__)
88

99

10-
class State402(object):
10+
class State402:
1111
# Controlword (0x6040) commands
1212
CW_OPERATION_ENABLED = 0x000F
1313
CW_SHUTDOWN = 0x0006
@@ -101,7 +101,7 @@ def next_state_indirect(_from):
101101
return next_state
102102

103103

104-
class OperationMode(object):
104+
class OperationMode:
105105
NO_MODE = 0
106106
PROFILED_POSITION = 1
107107
VELOCITY = 2
@@ -155,7 +155,7 @@ class OperationMode(object):
155155
}
156156

157157

158-
class Homing(object):
158+
class Homing:
159159
CW_START = 0x10
160160
CW_HALT = 0x100
161161

canopen/sdo/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from .. import variable
1010

1111

12-
class CrcXmodem(object):
12+
class CrcXmodem:
1313
"""Mimics CrcXmodem from crccheck."""
1414

1515
def __init__(self):

canopen/sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import Optional
44

55

6-
class SyncProducer(object):
6+
class SyncProducer:
77
"""Transmits a SYNC message periodically."""
88

99
#: COB-ID of the SYNC message

0 commit comments

Comments
 (0)