cwltool.cwlprov.writablebagfile
===============================

.. py:module:: cwltool.cwlprov.writablebagfile

.. autoapi-nested-parse::

   Stores class definition of ResearchObject and WritableBagFile.



Classes
-------

.. autoapisummary::

   cwltool.cwlprov.writablebagfile.WritableBagFile


Functions
---------

.. autoapisummary::

   cwltool.cwlprov.writablebagfile.write_bag_file
   cwltool.cwlprov.writablebagfile.open_log_file_for_activity
   cwltool.cwlprov.writablebagfile.close_ro
   cwltool.cwlprov.writablebagfile.packed_workflow
   cwltool.cwlprov.writablebagfile.create_job


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

.. py:class:: WritableBagFile(research_object, rel_path)

   Bases: :py:obj:`io.FileIO`

   .. autoapi-inheritance-diagram:: cwltool.cwlprov.writablebagfile.WritableBagFile
      :parts: 1


   Writes files in research object.


   .. py:attribute:: research_object


   .. py:attribute:: rel_path


   .. py:attribute:: hashes


   .. py:method:: write(b)

      Write some content to the Bag.



   .. py:method:: close()

      Flush and close this stream.

      Finalize checksums and manifests.



   .. py:method:: seekable()

      Return False, seeking is not supported.



   .. py:method:: readable()

      Return False, reading is not supported.



   .. py:method:: truncate(size = None)

      Resize the stream, only if we haven't started writing.



.. py:function:: write_bag_file(research_object, path, encoding = ENCODING)

   Write the bag file into our research object.


.. py:function:: open_log_file_for_activity(research_object, uuid_uri)

   Begin the per-activity log.


.. py:function:: close_ro(research_object, save_to = None)

   Close the Research Object, optionally saving to specified folder.

   Closing will remove any temporary files used by this research object.
   After calling this method, this ResearchObject instance can no longer
   be used, except for no-op calls to .close().

   The 'saveTo' folder should not exist - if it does, it will be deleted.

   It is safe to call this function multiple times without the
   'saveTo' argument, e.g. within a try..finally block to
   ensure the temporary files of this Research Object are removed.


.. py:function:: packed_workflow(research_object, packed)

   Pack CWL description to generate re-runnable CWL object in RO.


.. py:function:: create_job(research_object, builder_job, is_output = False)

   Generate the new job object with RO specific relative paths.


