Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
Fix file parsing with unexpected newlines closes #59
Browse files Browse the repository at this point in the history
  • Loading branch information
Boneill3 committed May 3, 2021
1 parent 691fe2e commit f11576a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion canopen_monitor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

MAJOR = 3
MINOR = 3
PATCH = 0
PATCH = 1

APP_NAME = 'canopen-monitor'
APP_DESCRIPTION = 'An NCurses-based TUI application for tracking activity' \
Expand Down
5 changes: 5 additions & 0 deletions canopen_monitor/parse/eds.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ def __init__(self, eds_data: [str]):
prev = 0
for i, line in enumerate(eds_data):
if line == '':
# Handle extra empty strings
if prev == i:
prev = i + 1
continue

section = eds_data[prev:i]
id = section[0][1:-1].split('sub')

Expand Down
2 changes: 2 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7738,6 +7738,7 @@
ParameterValue=
PDOMapping=0
[3100sub9]
ParameterName=Get apt list output
Denotation=
Expand All @@ -7748,4 +7749,5 @@
DefaultValue=
ParameterValue=
PDOMapping=0
"""

0 comments on commit f11576a

Please sign in to comment.