Skip to content

Commit 045defd

Browse files
committed
Remove lint.
1 parent 550ea1e commit 045defd

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

examples/example_cdi_access.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ def memoryReadSuccess(memo):
135135
if len(memo.data) == 64 and 0 not in memo.data:
136136
# save content
137137
resultingCDI += memo.data
138-
logger.debug(f"[{memo.address}] successful read {MemoryService.arrayToString(memo.data, len(memo.data))}; next = address + 64")
138+
logger.debug(
139+
f"[{memo.address}] successful read"
140+
f" {MemoryService.arrayToString(memo.data, len(memo.data))}"
141+
"; next = address + 64")
139142
# update the address
140143
memo.address = memo.address+64
141144
# and read again

examples/tkexamples/cdiform.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ def onTreeSelect(self, event: tk.Event):
170170
v_widget.cdivar = cdivar
171171
v_widget.tip = nameLabel.tip
172172

173-
174173
address_str = ""
175174
if address_str is not None:
176175
address_str = str(cm.address)
@@ -291,6 +290,7 @@ def _onPopScope(self, cm: CDIMemo):
291290
nameLower = cm.tag.lower() if cm.tag else None
292291
assert nameLower is not None # only None for done/fail events
293292
cm.content
293+
assert self._treeview is not None
294294
if nameLower == "name":
295295
parentIID = self.getParentBranch(cm)
296296
assert parentIID is not None, "name must be in a branch"
@@ -302,7 +302,7 @@ def _onPopScope(self, cm: CDIMemo):
302302
self.indent() + f"content is None for /{cm.tag}")
303303
cm.content = ""
304304
# "name" applies to parent, such as "segment" or "string"
305-
parent = self._treeview.item(
305+
_ = self._treeview.item(
306306
parentIID, text=cm.content.strip())
307307
origin = cm.element.attrib.get('origin') if cm.element else None
308308
if cm.content:
@@ -409,17 +409,17 @@ def _onPushScope(self, cm: CDIMemo):
409409
self.debug_write(name)
410410
# if attrs is not None and attrs:
411411
# self.debug(" {}".format(attrs_to_dict(attrs)))
412-
412+
assert self._treeview is not None
413413
if tagLower in ("segment", "group"):
414414
content = "" # Temporary (The visible text is set to content of
415415
# name element in _onPopScope)
416416
# if not name:
417417
if tagLower == "segment":
418418
space = cm.element.attrib['space']
419419
content = space
420-
origin = None
421-
if 'origin' in cm.element.attrib:
422-
origin = cm.element.attrib['origin']
420+
# origin = None
421+
# if 'origin' in cm.element.attrib:
422+
# origin = cm.element.attrib['origin']
423423
elif tagLower == "group":
424424
if 'offset' in cm.element.attrib:
425425
content = cm.element.attrib['offset']

openlcb/canbus/canlink.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,9 +790,7 @@ def handleReceivedData(self, frame: CanFrame):
790790
try:
791791
mapped = self.aliasToNodeID[destAlias]
792792
destID = mapped
793-
except KeyboardInterrupt:
794-
raise
795-
except:
793+
except KeyError:
796794
destID = NodeID(self.nextInternallyAssignedNodeID)
797795
self.nextInternallyAssignedNodeID += 1
798796
logger.warning(
@@ -1378,7 +1376,10 @@ def waitForReady(self, device: PortInterface, mode="binary",
13781376
# self.physicalLayer.receiveAll(device)
13791377
try:
13801378
data = device.receive() # If timeout, set non-blocking
1381-
self.physicalLayer.handleData(data)
1379+
if data is not None:
1380+
self.physicalLayer.handleData(data)
1381+
# else: None should never occur in non-blocking mode
1382+
# (See BlockingIOError instead)
13821383
except BlockingIOError:
13831384
# raised by receive if no data (non-blocking is
13841385
# what we want, so fall through).

openlcb/openlcbaction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ class OpenLCBAction:
33
See LCC "Configuration Description Information" Standard.
44
"""
55
pass
6-
# TODO: Finish this.
6+
# TODO: Finish this.

python-openlcb.code-workspace

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
"dunder",
5555
"frameencoder",
5656
"gaierror",
57+
"gethostname",
58+
"getpid",
5759
"gridargs",
5860
"gridconnectobserver",
5961
"issuecomment",
@@ -95,6 +97,7 @@
9597
"servicetype",
9698
"settingtypes",
9799
"setuptools",
100+
"SOCK_DGRAM",
98101
"sysdirs",
99102
"tcplink",
100103
"tcpsocket",

0 commit comments

Comments
 (0)