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 registerReturnCode( self, code ): check_for_nonnegative_int( code, "The return code of the build script has to be a non-negative integer number!" ) if self.__returnCode is None: # only if there was no previous error: self.__returnCode = code msg = 'return code {0} registered'.format( code ) if self.__returnCode == 0: self.message( self, msg ) else: self.error( self, msg ) else: self.debug( self, 'return code {0} registered - ignored because return code already set to {1}.' .format( code, self.getReturnCode() ) )
def preFlightCheck( self ): level = mApp().getSettings().get( Settings.ScriptLogLevel, True ) check_for_nonnegative_int( level, 'The debug level must be a non-negative integer!' ) if level > 0: mApp().debug( self, 'debug level is {0}'.format( level ) )
def _logDebugN( self, mapp, mobject, level , msg ): check_for_nonnegative_int( level, "The debug level needs to be an integer of zero or more" ) verbosity = self.__getLevel( mapp ) if verbosity >= level: self._logDebug( mapp, mobject, msg )
def __getLevel( mapp ): verbosity = mapp.getSettings().get( Settings.ScriptLogLevel ) check_for_nonnegative_int( verbosity, "The debug level needs to be an integer of zero or more" ) return verbosity