def setCommand( self, command, timeOutPeriod = None, searchPaths = None ): """Set the shell command""" check_for_list_of_paths( command, "The shell command must be a list of strings or paths." ) if timeOutPeriod != None: check_for_nonnegative_int( timeOutPeriod, 'invalid timeout period, valid periods are [0..inf] or None for no timeout' ) if searchPaths is None: searchPaths = [] check_for_list_of_paths( searchPaths, "The search paths need to be a list of strings." ) self.__command = command self.__timeOutPeriod = timeOutPeriod self.__searchPaths = searchPaths
def __init__( self, cmd, timeoutSeconds = None, combineOutput = False, searchPaths = None, captureOutput = True ): MObject.__init__( self ) check_for_list_of_paths( cmd, "The command must be a list of strings." ) self.__cmd = cmd if timeoutSeconds: check_for_positive_int( timeoutSeconds, "The timeout period must be a positive integer number! " ) self.__timeoutSeconds = timeoutSeconds self.__workingDir = None self.__captureOutput = captureOutput self.__combineOutput = combineOutput self.__stdOut = None self.__stdErr = None self.__returnCode = None self.__timedOut = False if searchPaths is None: self.__searchPaths = [] else: check_for_list_of_paths( searchPaths, "The search paths must be a list of strings." ) self.__searchPaths = searchPaths
def setExtraUploadSubDirs( self, listOfSubdirs ): check_for_list_of_paths( listOfSubdirs, 'The list of extra upload subdirectories most contains paths.' ) self.__extraUploadSubDirs = listOfSubdirs
def _setCommandSearchPaths( self, searchPaths ): if searchPaths is None: searchPaths = [] check_for_list_of_paths( searchPaths, "The search paths need to be a list of file system paths." ) self.__commandSearchPaths = searchPaths
def _setCommandArguments( self, commandArguments ): check_for_list_of_paths( commandArguments, "Must be a list of strings or PathResolver objects" ) self.__commandArguments = commandArguments
def __init__( self, folders ): check_for_list_of_paths( folders, 'The list of temporary folders must contain paths or resolvers!' ) self.__folders = folders