1- # mypy: disable-error-code="arg-type,union-attr"
21import importlib
32import os
43import sys
5049from strictdoc .export .html .renderers .link_renderer import LinkRenderer
5150from strictdoc .export .html .renderers .markup_renderer import MarkupRenderer
5251from strictdoc .export .html .tools .html_embedded import HTMLEmbedder
52+ from strictdoc .helpers .cast import assert_cast
5353from strictdoc .helpers .exception import StrictDocException
5454from strictdoc .helpers .file_modification_time import get_file_modification_time
5555from strictdoc .helpers .file_system import sync_dir
@@ -268,9 +268,12 @@ def export_assets(
268268
269269 redundant_assets : Dict [str , List [SDocRelativePath ]] = {}
270270 for document_ in traceability_index .document_tree .document_list :
271+ assert document_ .meta is not None
271272 for (
272273 included_document_
273274 ) in document_ .iterate_included_documents_depth_first ():
275+ assert included_document_ .meta is not None
276+
274277 redundant_assets .setdefault (
275278 document_ .meta .input_doc_assets_dir_rel_path .relative_path_posix ,
276279 [],
@@ -279,6 +282,8 @@ def export_assets(
279282 document_ .meta .input_doc_assets_dir_rel_path .relative_path_posix
280283 ].append (included_document_ .meta .input_doc_assets_dir_rel_path )
281284
285+ assert traceability_index .asset_manager is not None
286+
282287 asset_dir_ : AssetDir
283288 for asset_dir_ in traceability_index .asset_manager .iterate ():
284289 source_path = asset_dir_ .full_path
@@ -322,14 +327,16 @@ def export_single_document_with_performance(
322327 if specific_documents is None :
323328 specific_documents = DocumentType .all ()
324329
325- input_doc_full_path = document .meta .input_doc_full_path
326- output_doc_full_path = document .meta .output_document_full_path
330+ document_meta = assert_cast (document .meta , DocumentMeta )
331+
332+ input_doc_full_path = document_meta .input_doc_full_path
333+ output_doc_full_path = document_meta .output_document_full_path
327334
328335 if os .path .isfile (output_doc_full_path ) and (
329336 get_file_modification_time (input_doc_full_path )
330337 < get_file_modification_time (output_doc_full_path )
331338 and not traceability_index .file_dependency_manager .must_generate (
332- document . meta .input_doc_full_path
339+ document_meta .input_doc_full_path
333340 )
334341 ):
335342 with measure_performance (f"Skip: { document .title } " ):
0 commit comments