carputils
Doxygen code documentation for the python framework controlling openCARP
Functions
carputils.bundle.bundleinclude Namespace Reference

Manages .bundleinclude file, which allows to explicitely include files and folders to bundles. More...

Functions

def copy_bundleinclude (exp_dir, bundle_dir)
 Copy files and folders in the bundle according to the '.bundleinclude' file contained in exp_dir. More...
 
def temporary_cd (x)
 Context manager to temporarily change the current working directory. More...
 
def parse_bundleinclude_line (line, exp_dir)
 Parses a line of a .bundleinclude file. More...
 

Detailed Description

Manages .bundleinclude file, which allows to explicitely include files and folders to bundles.

The items listed in .bundleinclude must be contained in the experiment directory or one of its subdirectories.

Function Documentation

◆ copy_bundleinclude()

def carputils.bundle.bundleinclude.copy_bundleinclude (   exp_dir,
  bundle_dir 
)

Copy files and folders in the bundle according to the '.bundleinclude' file contained in exp_dir.

Files and folders can be provided using patterns, as in the glob module. Only files which are contained in the experiment directory or one of its subdirectories are copied.

Parameters
exp_dirstr the path to the original experiment directory.
bundle_dirstr the path to the bundle directory.

◆ parse_bundleinclude_line()

def carputils.bundle.bundleinclude.parse_bundleinclude_line (   line,
  exp_dir 
)

Parses a line of a .bundleinclude file.

Parameters
linestr a line of a .bundleinclude file. It must contain a pattern to match files and folders within exp_dir. If the line is empty, an empty list is returned.
Returns
A list of absolute paths corresponding to files and folders matching the pattern.

◆ temporary_cd()

def carputils.bundle.bundleinclude.temporary_cd (   x)

Context manager to temporarily change the current working directory.