:py:mod:`cwltool.context`
=========================

.. py:module:: cwltool.context

.. autoapi-nested-parse::

   Shared context objects that replace use of kwargs.



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

Classes
~~~~~~~

.. autoapisummary::

   cwltool.context.ContextBase
   cwltool.context.LoadingContext
   cwltool.context.RuntimeContext



Functions
~~~~~~~~~

.. autoapisummary::

   cwltool.context.make_tool_notimpl
   cwltool.context.log_handler
   cwltool.context.set_log_dir
   cwltool.context.getdefault



Attributes
~~~~~~~~~~

.. autoapisummary::

   cwltool.context.default_make_tool


.. py:class:: ContextBase(kwargs = None)


   Shared kwargs based initializer for :py:class:`RuntimeContext` and :py:class:`LoadingContext`.


.. py:function:: make_tool_notimpl(toolpath_object, loadingContext)

   Fake implementation of the make tool function.


.. py:data:: default_make_tool

   

.. py:function:: log_handler(outdir, base_path_logs, stdout_path, stderr_path)

   Move logs from log location to final output.


.. py:function:: set_log_dir(outdir, log_dir, subdir_name)

   Set the log directory.


.. py:class:: LoadingContext(kwargs = None)


   Bases: :py:obj:`ContextBase`

   .. autoapi-inheritance-diagram:: cwltool.context.LoadingContext
      :parts: 1

   Shared kwargs based initializer for :py:class:`RuntimeContext` and :py:class:`LoadingContext`.

   .. py:method:: copy()

      Return a copy of this :py:class:`LoadingContext`.



.. py:class:: RuntimeContext(kwargs = None)


   Bases: :py:obj:`ContextBase`

   .. autoapi-inheritance-diagram:: cwltool.context.RuntimeContext
      :parts: 1

   Shared kwargs based initializer for :py:class:`RuntimeContext` and :py:class:`LoadingContext`.

   .. py:attribute:: outdir
      :type: Optional[str]

      

   .. py:attribute:: tmpdir
      :type: str
      :value: ''

      

   .. py:attribute:: tmpdir_prefix
      :type: str

      

   .. py:attribute:: tmp_outdir_prefix
      :type: str
      :value: ''

      

   .. py:attribute:: stagedir
      :type: str
      :value: ''

      

   .. py:method:: get_outdir()

      Return :py:attr:`outdir` or create one with :py:attr:`tmp_outdir_prefix`.


   .. py:method:: get_tmpdir()

      Return :py:attr:`tmpdir` or create one with :py:attr:`tmpdir_prefix`.


   .. py:method:: get_stagedir()

      Return :py:attr:`stagedir` or create one with :py:attr:`tmpdir_prefix`.


   .. py:method:: create_tmpdir()

      Create a temporary directory that respects :py:attr:`tmpdir_prefix`.


   .. py:method:: create_outdir()

      Create a temporary directory that respects :py:attr:`tmp_outdir_prefix`.


   .. py:method:: copy()

      Return a copy of this :py:class:`RuntimeContext`.



.. py:function:: getdefault(val, default)

   Return the ``val`` using the ``default`` as backup in case the val is ``None``.


