File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
geos-trame/src/geos_trame/app Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -160,10 +160,12 @@ def write_files( self ):
160
160
files = self ._split ( pb )
161
161
162
162
for filepath , content in files .items ():
163
- includeName : str = self .input_file .xml_parser .file_to_relative_path [ filepath ]
164
163
model_loaded : BaseModel = self .decode_data ( content )
165
164
model_with_changes : BaseModel = self ._apply_changed_properties ( model_loaded )
166
- self ._append_include_file ( model_with_changes , includeName )
165
+
166
+ if self .input_file .xml_parser .contains_include_files ():
167
+ includeName : str = self .input_file .xml_parser .get_relative_path_of_file ( filepath )
168
+ self ._append_include_file ( model_with_changes , includeName )
167
169
168
170
model_as_xml : str = self .to_xml ( model_with_changes )
169
171
Original file line number Diff line number Diff line change @@ -61,6 +61,18 @@ def get_simulation_deck( self ) -> ElementTree.Element:
61
61
return
62
62
return self .simulation_deck
63
63
64
+ def contains_include_files ( self ) -> bool :
65
+ """
66
+ Return True if the parsed file contains included file or not.
67
+ """
68
+ return len ( self .file_to_relative_path ) > 0
69
+
70
+ def get_relative_path_of_file ( self , filename : str ) -> str :
71
+ """
72
+ Return the relative path of a given filename.
73
+ """
74
+ return self .file_to_relative_path [ filename ]
75
+
64
76
def _read ( self ) -> ElementTree .Element :
65
77
"""Reads an xml file (and recursively its included files) into memory
66
78
You can’t perform that action at this time.
0 commit comments