def getLogFilenames(self, unused=None, user=None, date=None): """ Overrides the :func:`~terapix.lib.cluster.condor.CondorCSF.getLogFilenames` static function (not static anymore). .. todo:: fixme The *unused* parameter is unused (here for signature constraint only), *user* is the current Django logged in :class:`~django.contrib.auth.models.User`, *date* is a custom :class:`~datetime.date` object. Returns a dictionnary with entries for the log, error and output filenames that should be used by plugins generating Condor submission files. The dictionnary has the ``log``, ``error`` and ``out`` keys. """ import datetime if date and not isinstance(date, datetime.date): raise TypeError, "Bad date" if user: username = user.username else: username = self.__request.user.username if date: pattern = os.path.join(get_temp_dir(username, self.__id, False), str(date), self.__id.upper() + ".%s") else: pattern = os.path.join(get_temp_dir(username, self.__id), self.__id.upper() + ".%s.$(Cluster).$(Process)") return {"log": pattern % "log", "error": pattern % "err", "out": pattern % "out"}
def getSubmitFilePath(self): """ Overrides the :func:`~terapix.lib.cluster.condor.CondorCSF.getSubmitFilePath` static function (not static anymore). """ return os.path.join( get_temp_dir(self.__request.user.username, self.__id), "CONDOR-%s-%s.csf" % (self.__id, time.time()) )
def getConfigFilePath(self): """ Return a path to a new Condor configuration file used for this processing. Each call generates a new filename so that no file gets overwritten. Returns a path to a new file. The returned name should then be used by plugins to add some content to it. """ return os.path.join( get_temp_dir(self.__request.user.username, self.__id), "%s-%s.rc" % (self.__id.upper(), time.time()) )