tmt/utils.py
def _workdir_init(self, id_):
        """
        Initialize the work directory

        Workdir under WORKDIR_ROOT is used/created if 'id' is provided.
        If 'id' is a path, that directory is used instead. Otherwise a
        new workdir is created under WORKDIR_ROOT.
        """
        # Construct the workdir
        if id_ is not None:
            # Use provided directory if path given
            if '/' in id_:
                workdir = id_
            # Construct directory name under workdir root
            else:
                if isinstance(id_, int):
                    id_ = str(id_).rjust(3, '0')
                directory = 'run-{}'.format(id_)
                workdir = os.path.join(WORKDIR_ROOT, directory)
        else:
            # Generate a unique run id
            for id_ in range(1, WORKDIR_MAX + 1):
                directory = 'run-{}'.format(str(id_).rjust(3, '0'))
                workdir = os.path.join(WORKDIR_ROOT, directory)
                if not os.path.exists(workdir):
                    break
            if id_ == WORKDIR_MAX:
                raise GeneralError(
                    "Cleanup the '{}' directory.".format(WORKDIR_ROOT))

        # Create the workdir
        create_directory(workdir, 'workdir', quiet=True)
        self._workdir = workdir

        Initialize the work directory

        Workdir under WORKDIR_ROOT is used/created if 'id' is provided.
        If 'id' is a path, that directory is used instead. Otherwise a
        new workdir is created under WORKDIR_ROOT.
        
Initialize the work directory
Workdir under WORKDIR_ROOT is used/created if 'id' is provided.
If 'id' is a path, that directory is used instead. Otherwise a
new workdir is created under WORKDIR_ROOT.
Initialize the work directory Workdir under WORKDIR_ROOT is used / created if ' id ' is provided . If ' id ' is a path that directory is used instead . Otherwise a new workdir is created under WORKDIR_ROOT .
def _workdir_init(self, id_):
        if id_ is not None:
            if '/' in id_:
                workdir = id_
            else:
                if isinstance(id_, int):
                    id_ = str(id_).rjust(3, '0')
                directory = 'run-{}'.format(id_)
                workdir = os.path.join(WORKDIR_ROOT, directory)
        else:
            for id_ in range(1, WORKDIR_MAX + 1):
                directory = 'run-{}'.format(str(id_).rjust(3, '0'))
                workdir = os.path.join(WORKDIR_ROOT, directory)
                if not os.path.exists(workdir):
                    break
            if id_ == WORKDIR_MAX:
                raise GeneralError(
                    "Cleanup the '{}' directory.".format(WORKDIR_ROOT))
        create_directory(workdir, 'workdir', quiet=True)
        self._workdir = workdir
def _workdir_init ( self , id_ ) : if id_ is not None : if '/' in id_ : workdir = id_ else : if isinstance ( id_ , int ) : id_ = str ( id_ ) . rjust ( 3 , '0' ) directory = 'run-{}' . format ( id_ ) workdir = os . path . join ( WORKDIR_ROOT , directory ) else : for id_ in range ( 1 , WORKDIR_MAX + 1 ) : directory = 'run-{}' . format ( str ( id_ ) . rjust ( 3 , '0' ) ) workdir = os . path . join ( WORKDIR_ROOT , directory ) if not os . path . exists ( workdir ) : break if id_ == WORKDIR_MAX : raise GeneralError ( "Cleanup the '{}' directory." . format ( WORKDIR_ROOT ) ) create_directory ( workdir , 'workdir' , quiet = True ) self . _workdir = workdir
Initialize the work directory
Workdir under WORKDIR_ROOT is used/created if 'id' is provided.
Initialize the work directory Workdir under WORKDIR_ROOT is used / created if ' id ' is provided .
"""
        Initialize the work directory

        Workdir under WORKDIR_ROOT is used/created if 'id' is provided.
        If 'id' is a path, that directory is used instead. Otherwise a
        new workdir is created under WORKDIR_ROOT.
        """ # Construct the workdir # Use provided directory if path given # Construct directory name under workdir root # Generate a unique run id # Create the workdir
self
id_