Skip to content

Commit 2fc50dc

Browse files
committed
Basic ruff fixes
1 parent 3c57bf0 commit 2fc50dc

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

dynamixel/devices/ax12a.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
#
44
# SPDX-License-Identifier: MIT
55

6+
import asyncio
7+
8+
from dynamixel import utils
69
from dynamixel.protocol import Protocol1, Response
710
from dynamixel.servo import Servo, paramUnit
8-
from dynamixel import utils
9-
import asyncio
1011

1112

1213
class operatingMode:
@@ -56,7 +57,7 @@ class AX12A(Servo):
5657
OPERATING_MODE = operatingMode
5758

5859
def __init__(self, *args, unit=PARAM_UNIT.UNIT_DEGREE, **kwargs):
59-
super(AX12A, self).__init__(*args, **kwargs)
60+
super().__init__(*args, **kwargs)
6061
self.protocol = Protocol1(**kwargs)
6162
self.unit = unit
6263
self.resolution = 1024

dynamixel/devices/xl430w250t.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
#
44
# SPDX-License-Identifier: MIT
55

6+
import asyncio
7+
8+
from dynamixel import utils
69
from dynamixel.protocol import Protocol2, Response
710
from dynamixel.servo import Servo, paramUnit
8-
from dynamixel import utils
9-
import asyncio
1011

1112

1213
class operatingMode:
@@ -76,7 +77,7 @@ class XL430_W250_T(Servo):
7677
OPERATING_MODE = operatingMode
7778

7879
def __init__(self, *args, unit=PARAM_UNIT.UNIT_DEGREE, **kwargs):
79-
super(XL430_W250_T, self).__init__(*args, **kwargs)
80+
super().__init__(*args, **kwargs)
8081
self.unit = unit
8182
self.protocol: Protocol2 = Protocol2(**kwargs)
8283
self.resolution = 4096

dynamixel/protocol.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
#
44
# SPDX-License-Identifier: MIT
55

6-
import digitalio
76
import time
8-
import busio
7+
98
import board
9+
import busio
10+
import digitalio
11+
1012
from .utils import Lock
1113

1214

@@ -107,12 +109,12 @@ class StatusPacket:
107109

108110
def __new__(cls, *args, **kwargs):
109111
if not cls._instance:
110-
cls._instance = super(Protocol1, cls).__new__(cls)
112+
cls._instance = super().__new__(cls)
111113
return cls._instance
112114

113115
def __init__(self, *args, **kwargs):
114116
if not self.initialized:
115-
super(Protocol1, self).__init__(*args, **kwargs)
117+
super().__init__(*args, **kwargs)
116118
self.initialized = True
117119
self.STATUS_ERRORS = [
118120
None,
@@ -348,12 +350,12 @@ class Packet:
348350

349351
def __new__(cls, *args, **kwargs):
350352
if not cls._instance:
351-
cls._instance = super(Protocol2, cls).__new__(cls)
353+
cls._instance = super().__new__(cls)
352354
return cls._instance
353355

354356
def __init__(self, *args, **kwargs):
355357
if not self.initialized:
356-
super(Protocol2, self).__init__(*args, **kwargs)
358+
super().__init__(*args, **kwargs)
357359
self.initialized = True
358360
self.STATUS_ERRORS = [
359361
None,

examples/dynamixel_simpletest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44
# SPDX-License-Identifier: MIT
55
import time
6+
67
from dynamixel.devices import XL430_W250_T
78

89
m = XL430_W250_T("", 1)

0 commit comments

Comments
 (0)