Skip to content

Commit 91c5165

Browse files
committed
add logging
1 parent e2a8824 commit 91c5165

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

file_utils.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,11 @@ def get_existing_files_content(build_folder, existing_files):
203203

204204
def store_response_files(target_folder, response_files, existing_files):
205205
for file_name in response_files:
206+
console.debug(f"OLA store_response_files file_name: {file_name} full_file_name: {full_file_name}")
206207
full_file_name = os.path.join(target_folder, file_name)
207208

208209
if response_files[file_name] is None:
210+
console.debug(f"OLA file_name {file_name} should be deleted")
209211
# None content indicates that the file should be deleted.
210212
if os.path.exists(full_file_name):
211213
os.remove(full_file_name)
@@ -218,7 +220,9 @@ def store_response_files(target_folder, response_files, existing_files):
218220
os.makedirs(os.path.dirname(full_file_name), exist_ok=True)
219221

220222
with open(full_file_name, "w") as f:
221-
f.write(response_files[file_name])
223+
console.debug(f"OLA writing to file {file_name} content before: {]}")
224+
console.debug(f"OLA writing to file {file_name} content after: {response_files[file_name]}")
225+
f.write(normalize_line_endings(response_files[file_name]))
222226

223227
if file_name not in existing_files:
224228
existing_files.append(file_name)
@@ -256,15 +260,17 @@ def load_linked_resources(template_dirs: list[str], resources_list, module_name:
256260
)
257261

258262
if content is None:
259-
raise FileNotFoundError(f"""File not found:
263+
raise FileNotFoundError(
264+
f"""File not found:
260265
Resource file {file_name} not found. Resource files are searched in the following order (highest to lowest precedence):
261266

262267
1. The directory containing your .plain file
263268
2. The directory specified by --template-dir (if provided)
264269
3. The built-in 'standard_template_library' directory
265270

266271
Please ensure that the resource exists in one of these locations, or specify the correct --template-dir if using custom templates.
267-
""")
272+
"""
273+
)
268274

269275
linked_resources[file_name] = content
270276

0 commit comments

Comments
 (0)