1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-27 00:41:20 +02:00

add sep char test

This commit is contained in:
Kelly Brazil
2022-05-02 11:15:41 -07:00
parent 4a7f1bed3a
commit 86c279cbb2
2 changed files with 74 additions and 8 deletions

View File

@ -386,8 +386,8 @@ def _collapse_data(table: List[List[List[str]]], quiet=False) -> List[List[str]]
"""combine data rows to return a simple list of lists"""
result: List[List[str]] = []
try:
for index, row in enumerate(table):
for index, row in enumerate(table):
try:
new_row: List[str] = []
for line in row:
if new_row:
@ -397,12 +397,12 @@ def _collapse_data(table: List[List[List[str]]], quiet=False) -> List[List[str]]
new_row = line
result.append(new_row)
except IndexError:
if not quiet:
row_string = '\n'.join([' | '.join(l) for l in row])
jc.utils.warning_message(
[f'Possible table separator character found in row {index}: {row_string}. Skipping.']
)
except IndexError:
if not quiet:
row_string = '\n'.join([' | '.join(l) for l in row])
jc.utils.warning_message(
[f'Possible table separator character found in row {index}: {row_string}. Skipping.']
)
return result