#NEWLINE# @ staticmethod #NEWLINE# def getWorkflowDir( workflowID , configWorkDir = None ) : #NEWLINE# #INDENT# '\n        Returns a path to the directory where worker directories and the cache will be located for this\n        workflow.\n\n        :param str workflowID: Unique identifier for the workflow\n        :param str configWorkDir: Value passed to the program using the --workDir flag\n        :return: Path to the workflow directory\n        :rtype: str\n        ' #NEWLINE# workDir = ( configWorkDir or os . getenv ( 'TOIL_WORKDIR' ) or tempfile . gettempdir ( ) ) #NEWLINE# if ( not os . path . exists ( workDir ) ) : #NEWLINE# #INDENT# raise RuntimeError ( ( 'The directory specified by --workDir or TOIL_WORKDIR (%s) does not exist.' % workDir ) ) #NEWLINE# #UNINDENT# workflowDir = os . path . join ( workDir , ( 'toil-%s' % workflowID ) ) #NEWLINE# try : #NEWLINE# #INDENT# os . mkdir ( workflowDir ) #NEWLINE# #UNINDENT# except OSError as err : #NEWLINE# #INDENT# if ( err . errno != 17 ) : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# logger . info ( ( 'Created the workflow directory at %s' % workflowDir ) ) #NEWLINE# #UNINDENT# return workflowDir