Skip to content

Commit d888f47

Browse files
committed
fix flake8 error
E128 continuation line under-indented for visual indent Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
1 parent ba45eb0 commit d888f47

13 files changed

Lines changed: 45 additions & 45 deletions

File tree

examples/interface_rmcp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66

77
intf = pyipmi.interfaces.create_interface('rmcp',
8-
slave_address=0x81,
9-
host_target_address=0x20,
10-
keep_alive_interval=0)
8+
slave_address=0x81,
9+
host_target_address=0x20,
10+
keep_alive_interval=0)
1111
sess = pyipmi.Session()
1212
sess.set_session_type_rmcp('10.0.114.116', 623)
1313
sess.set_auth_type_user('admin', 'admin')

pyipmi/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class Target(object):
9898
ipmb_address = None
9999

100100
def __init__(self, ipmb_address: int | None = None,
101-
routing: str | list[tuple] | None = None) -> None:
101+
routing: str | list[tuple] | None = None) -> None:
102102
"""Initializer for the Target class.
103103
104104
`ipmb_address` is the IPMB target address
@@ -165,8 +165,8 @@ class Ipmi(bmc.Bmc, chassis.Chassis, dcmi.Dcmi, fru.Fru, picmg.Picmg, hpm.Hpm,
165165
messaging.Messaging):
166166

167167
def __init__(self, interface: Any = None, target: Target | None = None,
168-
session: Session = Session(),
169-
requester: Any = NullRequester()) -> None:
168+
session: Session = Session(),
169+
requester: Any = NullRequester()) -> None:
170170
self._interface = interface
171171

172172
# we need a session, set if not passed
@@ -187,7 +187,7 @@ def __enter__(self) -> Ipmi:
187187
return self
188188

189189
def __exit__(self, exception_type: Any, exception_value: Any,
190-
traceback: Any) -> bool:
190+
traceback: Any) -> bool:
191191
self.close()
192192
return False
193193

pyipmi/bmc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ def i2c_write_read(self, bus_type: int, bus_id: int, channel: int,
5353
return rsp.data
5454

5555
def i2c_write(self, bus_type: int, bus_id: int, channel: int,
56-
address: int, data: bytes) -> None:
56+
address: int, data: bytes) -> None:
5757
self.i2c_write_read(bus_type, bus_id, channel, address, 0, data)
5858

5959
def i2c_read(self, bus_type: int, bus_id: int, channel: int,
60-
address: int, count: int) -> array:
60+
address: int, count: int) -> array:
6161
return self.i2c_write_read(bus_type, bus_id, channel,
6262
address, count, None)
6363

pyipmi/errors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class CompletionCodeError(Exception):
3838
"""IPMI completion code not OK."""
3939

4040
def __init__(self, cc: int, cmdid: int | None = None,
41-
netfn: int | None = None,
42-
group_extension: int | None = None) -> None:
41+
netfn: int | None = None,
42+
group_extension: int | None = None) -> None:
4343
self.cc = cc
4444
self.cc_desc = self.find_cc_desc(cc, cmdid, netfn, group_extension)
4545

pyipmi/fields.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class TypeLengthString(object):
8080
TYPE_ASCII_OR_UTF16 = 3
8181

8282
def __init__(self, data: bytes | None = None, offset: int = 0,
83-
force_lang_eng: bool = False, sdr: bool = False) -> None:
83+
force_lang_eng: bool = False, sdr: bool = False) -> None:
8484
if data:
8585
self._from_data(data, offset, force_lang_eng)
8686

@@ -110,7 +110,7 @@ def _from_data(self, data: bytes, offset: int = 0,
110110
class FruTypeLengthString(TypeLengthString):
111111

112112
def __init__(self, data: bytes | None = None, offset: int = 0,
113-
force_lang_eng: bool = False) -> None:
113+
force_lang_eng: bool = False) -> None:
114114
super(FruTypeLengthString, self).__init__(data, offset,
115115
force_lang_eng,
116116
sdr=False)
@@ -119,5 +119,5 @@ def __init__(self, data: bytes | None = None, offset: int = 0,
119119
class SdrTypeLengthString(TypeLengthString):
120120

121121
def __init__(self, data: bytes | None = None, offset: int = 0,
122-
force_lang_eng: bool = False) -> None:
122+
force_lang_eng: bool = False) -> None:
123123
super(SdrTypeLengthString, self).__init__(data, sdr=True)

pyipmi/fru.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def write_fru_data(self, data: bytes, offset: int = 0,
5454
offset += len(chunk)
5555

5656
def read_fru_data(self, offset: int | None = None,
57-
count: int | None = None, fru_id: int = 0) -> bytes:
57+
count: int | None = None, fru_id: int = 0) -> bytes:
5858
req_size = 32
5959
data = array.array('B')
6060

@@ -153,7 +153,7 @@ def get_fru_multirecord_area(self, fru_id: int = 0,
153153
return InventoryMultiRecordArea(data, ignore_checksum=ignore_checksum)
154154

155155
def get_fru_inventory(self, fru_id: int = 0,
156-
ignore_checksum: bool = False) -> FruInventory:
156+
ignore_checksum: bool = False) -> FruInventory:
157157
"""
158158
Get the full parsed FRU inventory data.
159159
"""
@@ -192,7 +192,7 @@ def get_fru_inventory(self, fru_id: int = 0,
192192

193193

194194
def get_fru_inventory_from_file(filename: str,
195-
ignore_checksum: bool = False) -> FruInventory:
195+
ignore_checksum: bool = False) -> FruInventory:
196196
try:
197197
file = open(filename, "rb")
198198
except IOError:
@@ -222,7 +222,7 @@ def _decode_custom_fields(data: bytes) -> list[FruTypeLengthString]:
222222

223223
class FruData(object):
224224
def __init__(self, data: bytes | str | None = None,
225-
ignore_checksum: bool = False) -> None:
225+
ignore_checksum: bool = False) -> None:
226226
if data:
227227
if isinstance(data, str):
228228
data = [ord(c) for c in data]
@@ -456,7 +456,7 @@ def _from_data(self, data: bytes, ignore_checksum: bool = False) -> None:
456456

457457
class FruInventory(object):
458458
def __init__(self, data: bytes | None = None,
459-
ignore_checksum: bool = False) -> None:
459+
ignore_checksum: bool = False) -> None:
460460
self.chassis_info_area = None
461461
self.board_info_area = None
462462
self.product_info_area = None

pyipmi/hpm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def get_target_upgrade_capabilities(self) -> TargetUpgradeCapabilities:
7777
return TargetUpgradeCapabilities(rsp)
7878

7979
def get_component_property(self, component_id: int,
80-
property_id: int) -> ComponentProperty | None:
80+
property_id: int) -> ComponentProperty | None:
8181
rsp = self.send_message_with_name('GetComponentProperties',
8282
id=component_id,
8383
selector=property_id)

pyipmi/interfaces/ipmbdev.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class IpmbDev(object):
1919
NAME = 'ipmbdev'
2020

2121
def __init__(self, slave_address: int = 0x20,
22-
port: str = '/dev/ipmb-0') -> None:
22+
port: str = '/dev/ipmb-0') -> None:
2323
# TODO: slave address is currently not defined here
2424
self.slave_address = slave_address
2525
self.port = port

pyipmi/interfaces/rmcp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class IpmiMsg(object):
233233
HEADER_FORMAT_AUTH = '!BII16BB'
234234

235235
def __init__(self, session: Session | None = None,
236-
ignore_sdu_length: bool = False) -> None:
236+
ignore_sdu_length: bool = False) -> None:
237237
self.session = session
238238
self.ignore_sdu_length = ignore_sdu_length
239239

@@ -366,9 +366,9 @@ class Rmcp(object):
366366
_session: Session | None = None
367367

368368
def __init__(self, slave_address: int = 0x81,
369-
host_target_address: int = 0x20,
370-
keep_alive_interval: int = 1, max_retries: int = 0,
371-
quirks_cfg: dict = dict()) -> None:
369+
host_target_address: int = 0x20,
370+
keep_alive_interval: int = 1, max_retries: int = 0,
371+
quirks_cfg: dict = dict()) -> None:
372372
"""Native RMCP interface constructor
373373
374374
Parameter `quirks_cfg`: a dict of additional configuration parameters

pyipmi/msgs/message.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
class BaseField(object):
2929
def __init__(self, name: str, length: int | None,
30-
default: Any = None) -> None:
30+
default: Any = None) -> None:
3131
self.name = name
3232
self.length = length
3333
self.default = default
@@ -46,7 +46,7 @@ def create(self) -> Any:
4646

4747
class ByteArray(BaseField):
4848
def __init__(self, name: str, length: int,
49-
default: bytes | None = None) -> None:
49+
default: bytes | None = None) -> None:
5050
BaseField.__init__(self, name, length)
5151
if default is not None:
5252
self.default = array('B', default)
@@ -140,7 +140,7 @@ def decode(self, obj: Message, data: ByteBuffer) -> None:
140140

141141
class UnsignedIntMask(UnsignedInt):
142142
def __init__(self, name: str, length: int, mask: int,
143-
default: int | None = None) -> None:
143+
default: int | None = None) -> None:
144144
UnsignedInt.__init__(self, name, length, default)
145145

146146

@@ -151,7 +151,7 @@ def __init__(self, name: str) -> None:
151151

152152
class Conditional(object):
153153
def __init__(self, cond_fn: Callable[[Message], bool],
154-
field: BaseField) -> None:
154+
field: BaseField) -> None:
155155
self._condition_fn = cond_fn
156156
self._field = field
157157

@@ -210,7 +210,7 @@ def create(self) -> array:
210210
class Bitfield(BaseField):
211211
class Bit(object):
212212
def __init__(self, name: str, width: int = 1,
213-
default: int | None = None) -> None:
213+
default: int | None = None) -> None:
214214
self.name = name
215215
self._width = width
216216
self.default = default
@@ -226,7 +226,7 @@ def __init__(self, width: int, default: int = 0) -> None:
226226

227227
class BitWrapper(object):
228228
def __init__(self, bits: tuple[Bitfield.Bit, ...],
229-
length: int) -> None:
229+
length: int) -> None:
230230
self._bits = bits
231231
self._length = length
232232
for bit in bits:
@@ -307,7 +307,7 @@ def create(self) -> Bitfield.BitWrapper:
307307

308308
class GroupExtensionIdentifier(UnsignedInt):
309309
def __init__(self, name: str = 'picmg_identifier',
310-
value: int | None = None) -> None:
310+
value: int | None = None) -> None:
311311
UnsignedInt.__init__(self, name, 1, value)
312312

313313

0 commit comments

Comments
 (0)