Skip to content

Commit

Permalink
Fixed a bug in the fodt-set-keyword-status script
Browse files Browse the repository at this point in the history
A newline was accidentally gobbled up by the script
  • Loading branch information
hakonhagland committed May 23, 2024
1 parent fe050de commit a5fc94d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
25 changes: 14 additions & 11 deletions parts/appendices/A.fodt
Original file line number Diff line number Diff line change
Expand Up @@ -6778,14 +6778,14 @@ Updated with AFR/TSA Rev-D comments and new keywords.</dc:description><meta:init
<table:table-cell table:style-name="AppendixA_TableCell" table:number-columns-spanned="7" office:value-type="string">
<text:p text:style-name="_40_Table_20_Contents"><text:a xlink:type="simple" xlink:href="#0.0.0.ACF" text:style-name="Internet_20_link" text:visited-style-name="Visited_20_Internet_20_Link"><text:bookmark-ref text:reference-format="text" text:ref-name="REF_HEADING_KEYWORD_ACF">ACF – Define Acentric Factors</text:bookmark-ref></text:a></text:p>
</table:table-cell>
<table:covered-table-cell></table:covered-table-cell>
<table:covered-table-cell></table:covered-table-cell>
<table:covered-table-cell></table:covered-table-cell>
<table:covered-table-cell></table:covered-table-cell>
<table:covered-table-cell></table:covered-table-cell>
<table:covered-table-cell></table:covered-table-cell>
<table:covered-table-cell/>
<table:covered-table-cell/>
<table:covered-table-cell/>
<table:covered-table-cell/>
<table:covered-table-cell/>
<table:covered-table-cell/>
<table:table-cell table:style-name="AppendixA_TableCell_Orange" office:value-type="string">
<text:p text:style-name="_40_Table_20_Contents"></text:p>
<text:p text:style-name="_40_Table_20_Contents"/>
</table:table-cell>
</table:table-row><table:table-row table:style-name="Table35.2">
<table:table-cell table:style-name="Table35.A5" table:number-columns-spanned="7" office:value-type="string">
Expand All @@ -6812,7 +6812,8 @@ Updated with AFR/TSA Rev-D comments and new keywords.</dc:description><meta:init
<table:covered-table-cell/>
<table:covered-table-cell/>
<table:table-cell table:style-name="Table38.H21" office:value-type="string">
<text:p text:style-name="P2480"/> </table:table-cell>
<text:p text:style-name="P2480"/>
</table:table-cell>
</table:table-row>
<table:table-row table:style-name="Table35.2">
<table:table-cell table:style-name="Table35.A48" table:number-columns-spanned="7" office:value-type="string">
Expand All @@ -6824,8 +6825,9 @@ Updated with AFR/TSA Rev-D comments and new keywords.</dc:description><meta:init
<table:covered-table-cell/>
<table:covered-table-cell/>
<table:covered-table-cell/>
<table:table-cell table:style-name="Table35.H9" office:value-type="string">
<text:p text:style-name="P2480"/> </table:table-cell>
<table:table-cell table:style-name="Table47.H7" office:value-type="string">
<text:p text:style-name="P2480"></text:p>
</table:table-cell>
</table:table-row>
<table:table-row table:style-name="Table35.2">
<table:table-cell table:style-name="Table35.A48" table:number-columns-spanned="7" office:value-type="string">
Expand All @@ -6838,7 +6840,8 @@ Updated with AFR/TSA Rev-D comments and new keywords.</dc:description><meta:init
<table:covered-table-cell/>
<table:covered-table-cell/>
<table:table-cell table:style-name="Table40.H8" office:value-type="string">
<text:p text:style-name="P2480"/> </table:table-cell>
<text:p text:style-name="P2480"/>
</table:table-cell>
</table:table-row>
<table:table-row table:style-name="Table35.2">
<table:table-cell table:style-name="Table35.A48" table:number-columns-spanned="7" office:value-type="string">
Expand Down
9 changes: 5 additions & 4 deletions scripts/python/src/fodt/add_keyword_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@ def endElement(self, name: str):
self.in_table_cell = False
elif self.in_table_cell_style and name == "style:style":
self.in_table_cell_style = False
if self.in_table_cell_p and name == "text:p" and self.start_tag_open and self.opm_flow:
if self.in_table_cell_p and name == "text:p" and self.start_tag_open:
self.content.write(">")
self.start_tag_open = False
content = "OPM Flow"
self.keyword_handled = True
self.current_keyword = None
self.in_table_cell_p = False
self.found_table_cell = False
self.content.write(XMLHelper.escape(content))
if self.opm_flow:
content = "OPM Flow"
self.content.write(XMLHelper.escape(content))
if self.start_tag_open:
self.content.write("/>")
self.start_tag_open = False
Expand Down Expand Up @@ -229,7 +230,7 @@ def set_keyword_status(
try:
color = KeywordStatus[color.upper()]
except ValueError:
raise ValueError(f"Invalid status value: {status}.")
raise ValueError(f"Invalid color value: {color}.")
logging.info(f"Updating parameters for keyword {keyword}: Color: {color}, flow-specific keyword: {opm_flow}.")
UpdateKeywordStatus(maindir, keyword, color, opm_flow).update()

Expand Down

0 comments on commit a5fc94d

Please sign in to comment.