anod.buildspace
===============

.. py:module:: anod.buildspace


Attributes
----------

.. autoapisummary::

   anod.buildspace.logger


Classes
-------

.. autoapisummary::

   anod.buildspace.BuildSpace


Module Contents
---------------

.. py:data:: logger

.. py:class:: BuildSpace(root_dir: str)

   Build space located inside a sandbox.


   .. py:attribute:: DIRS
      :value: ('binary', 'build', 'install', 'log', 'pkg', 'results', 'src', 'test', 'tmp')



   .. py:attribute:: directory_mapping


   .. py:attribute:: root_dir
      :value: b'.'



   .. py:attribute:: initialized
      :value: False



   .. py:method:: exists() -> bool

      Return True if the build space exists on disk.

      This function just checks the contents of self.root_dir,
      and verifies that it appears to be a build space.
      It does so, irrespective of whether self.initialize
      is True or not.

      :return: True if self.root_dir is a buildspace, False otherwise.



   .. py:property:: dirs
      :type: list[str]



   .. py:method:: subdir(name: str) -> str


   .. py:method:: __getattr__(name: str) -> str


   .. py:method:: __getitem__(key: str) -> str | None


   .. py:method:: create(quiet: bool = False) -> None

      Create a build space.

      The function create all the necessary directories and files to have
      a valid build space. If the build space already exists, only tmp
      directory content is reset.

      :param quiet: do not print info messages



   .. py:method:: reset(keep: list[str] | None = None) -> None

      Reset build space.

      The function delete the complete buildspace. The only elements that
      are not deleted are the logs, the testsuite results and any
      subdirectories in keep parameter

      A call to self.create() is needed after calling this function.

      :param keep: a list of directory to keep in addition
          to results and log. Each element should be part of BuildSpace.DIRS



