Skip to content

Fix EBDs with "*" in step_number#108

Merged
hf-kklein merged 19 commits intomainfrom
DDB/issue21
Sep 12, 2023
Merged

Fix EBDs with "*" in step_number#108
hf-kklein merged 19 commits intomainfrom
DDB/issue21

Conversation

@DeltaDaniel
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@hf-kklein hf-kklein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ehrlich gesagt hab' ichs nicht selbst gedebuggt, aber wenn es den Test besteht, und sonst nichts kaputt macht dann passt das 👍
Ein paar anmerkungen hatte ich noch. Kannst du die noch einbauen?

Comment thread src/ebddocx2table/docxtableconverter.py Outdated
As above, the results are written into rows, sub_rows and multi_step_instructions. Those will be modified.
"""
use_cases: List[str] = []
# first init
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# first init

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/ebddocx2table/docxtableconverter.py Outdated
enhanced_table_row.cells[len(use_cases) + self._column_index_check_result]
)

if row_index == len(self._enhance_list_view(table=table, row_offset=row_offset)) - 1:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if row_index == len(self._enhance_list_view(table=table, row_offset=row_offset)) - 1:
this_is_the_last_row = row_index == len(self._enhance_list_view(table=table, row_offset=row_offset)) - 1
if this_is_the_last_row:

das ist mehr readable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/ebddocx2table/docxtableconverter.py Outdated
"""
use_cases: List[str] = []
# first init
enhanced_table_row = self._enhance_list_view(table=table, row_offset=row_offset)[row_index]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

magst du das self._enhance_list_view(table=table, row_offset=row_offset) noch in eine variable mit lesbasrem namen verpacken?
du verwendest es ja an 4 stellen im nachfolgenden.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/ebddocx2table/docxtableconverter.py Outdated
def _handle_single_table_star_exception(
self,
table: Table,
multi_step_instructions: List[MultiStepInstruction],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
multi_step_instructions: List[MultiStepInstruction],
multi_step_instructions: list[MultiStepInstruction],

pep585

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/ebddocx2table/docxtableconverter.py Outdated
table: Table,
multi_step_instructions: List[MultiStepInstruction],
row_offset: int,
rows: List[EbdTableRow],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rows: List[EbdTableRow],
rows: list[EbdTableRow],

https://peps.python.org/pep-0585/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/ebddocx2table/docxtableconverter.py Outdated
with several instructions. Those instructions will be split in individual steps.
As above, the results are written into rows, sub_rows and multi_step_instructions. Those will be modified.
"""
use_cases: List[str] = []
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use_cases: List[str] = []
use_cases: list[str] = []

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/ebddocx2table/docxtableconverter.py Outdated
star_case_note = enhanced_table_row.cells[len(use_cases) + self._column_index_note].text.strip() or None
while row_index < len(self._enhance_list_view(table=table, row_offset=row_offset)):
enhanced_table_row = self._enhance_list_view(table=table, row_offset=row_offset)[row_index]
step_number = str(int(rows[-1].step_number) + 1)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
step_number = str(int(rows[-1].step_number) + 1)
step_number = str(int(last(rows).step_number) + 1)

find ich lesbarer. ist aber nicht wichtig

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hf-kklein hf-kklein changed the title Fix EBDs with "*" in step_number Fix EBDs with "*" in step_number Sep 11, 2023
@Hochfrequenz Hochfrequenz locked and limited conversation to collaborators Sep 12, 2023
@Hochfrequenz Hochfrequenz unlocked this conversation Sep 12, 2023
@hf-kklein hf-kklein marked this pull request as ready for review September 12, 2023 05:29
@hf-kklein hf-kklein merged commit c27fbd0 into main Sep 12, 2023
@hf-kklein hf-kklein deleted the DDB/issue21 branch September 12, 2023 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants