|
| 1 | +docbuild.cli.cmd_metadata |
| 2 | +========================= |
| 3 | + |
| 4 | +.. py:module:: docbuild.cli.cmd_metadata |
| 5 | +
|
| 6 | +.. autoapi-nested-parse:: |
| 7 | + |
| 8 | + Extracts metadata from deliverables. |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +Functions |
| 13 | +--------- |
| 14 | + |
| 15 | +.. autoapisummary:: |
| 16 | + |
| 17 | + docbuild.cli.cmd_metadata.get_deliverable_from_doctype |
| 18 | + docbuild.cli.cmd_metadata.process_deliverable |
| 19 | + docbuild.cli.cmd_metadata.process_doctype |
| 20 | + docbuild.cli.cmd_metadata.process |
| 21 | + docbuild.cli.cmd_metadata.metadata |
| 22 | + |
| 23 | + |
| 24 | +Package Contents |
| 25 | +---------------- |
| 26 | + |
| 27 | +.. py:function:: get_deliverable_from_doctype(root: lxml.etree._ElementTree, context: docbuild.cli.context.DocBuildContext, doctype: docbuild.models.doctype.Doctype) -> list[docbuild.models.deliverable.Deliverable] |
| 28 | +
|
| 29 | + Get deliverable from doctype. |
| 30 | + |
| 31 | + :param root: The stitched XML node containing configuration. |
| 32 | + :param context: The DocBuildContext containing environment configuration. |
| 33 | + :param doctype: The Doctype object to process. |
| 34 | + :return: A list of deliverables for the given doctype. |
| 35 | + |
| 36 | + |
| 37 | +.. py:function:: process_deliverable(deliverable: docbuild.models.deliverable.Deliverable, *, repo_dir: pathlib.Path, temp_repo_dir: pathlib.Path, base_cache_dir: pathlib.Path, meta_cache_dir: pathlib.Path, dapstmpl: str) -> bool |
| 38 | + :async: |
| 39 | + |
| 40 | + |
| 41 | + Process a single deliverable. |
| 42 | + |
| 43 | + This function creates a temporary clone of the deliverable's repository, |
| 44 | + checks out the correct branch, and then executes the DAPS command to |
| 45 | + generate metadata. |
| 46 | + |
| 47 | + :param deliverable: The Deliverable object to process. |
| 48 | + :param repo_dir: The permanent repo path taken from the env |
| 49 | + config ``paths.repo_dir`` |
| 50 | + :param temp_repo_dir: The temporary repo path taken from the env |
| 51 | + config ``paths.temp_repo_dir`` |
| 52 | + :param base_cache_dir: The base path of the cache directory taken |
| 53 | + from the env config ``paths.base_cache_dir`` |
| 54 | + :param meta_cache_dir: The ath of the metadata directory taken |
| 55 | + from the env config ``paths.meta_cache_dir`` |
| 56 | + :param dapstmp: A template string with the daps command and potential |
| 57 | + placeholders |
| 58 | + :return: True if successful, False otherwise. |
| 59 | + :raises ValueError: If required configuration paths are missing. |
| 60 | + |
| 61 | + |
| 62 | +.. py:function:: process_doctype(root: lxml.etree._ElementTree, context: docbuild.cli.context.DocBuildContext, doctype: docbuild.models.doctype.Doctype) -> bool |
| 63 | + :async: |
| 64 | + |
| 65 | + |
| 66 | + Process the doctypes and create metadata files. |
| 67 | + |
| 68 | + :param root: The stitched XML node containing configuration. |
| 69 | + :param context: The DocBuildContext containing environment configuration. |
| 70 | + :param doctypes: A tuple of Doctype objects to process. |
| 71 | + |
| 72 | + |
| 73 | +.. py:function:: process(context: docbuild.cli.context.DocBuildContext, doctypes: tuple[docbuild.models.doctype.Doctype]) -> int |
| 74 | + :async: |
| 75 | + |
| 76 | + |
| 77 | + Asynchronous function to process metadata retrieval. |
| 78 | + |
| 79 | + :param context: The DocBuildContext containing environment configuration. |
| 80 | + :param xmlfiles: A tuple or iterator of XML file paths to validate. |
| 81 | + :raises ValueError: If no envconfig is found or if paths are not |
| 82 | + configured correctly. |
| 83 | + :return: 0 if all files passed validation, 1 if any failures occurred. |
| 84 | + |
| 85 | + |
| 86 | +.. py:function:: metadata(ctx: click.Context, doctypes: tuple[docbuild.models.doctype.Doctype]) -> None |
| 87 | +
|
| 88 | + Subcommand to create metadata files. |
| 89 | + |
| 90 | + :param ctx: The Click context object. |
| 91 | + |
| 92 | + |
0 commit comments