Пример #1
0
 def _expandWithPid(self, val):
     if self._proc:
         self._env['pid'] = self._proc.pid
     else:
         if 'pid' in self._env:
             del self._env['pid']
     return expandVal(val, self._env)
Пример #2
0
 def _expandWithPid(self, val):
     if self._proc:
         self._env['pid'] = self._proc.pid
     else:
         if 'pid' in self._env:
             del self._env['pid']
     return expandVal(val, self._env)
Пример #3
0
def _findUniqueFileAndSetSymLink(fnameTemplate, env):
    if re.search(UNIQUE_REGEX, fnameTemplate):
        for i in xrange(0, 10000):
            uniqStr = '%s-%d' % (getFileNameTimeString(), i)
            fname = _expandUniq(fnameTemplate, uniqStr, env)
            if not os.path.exists(fname):
                symSrc = os.path.basename(fname)
                symTarget = _expandUniq(fnameTemplate, 'latest', env)
                _forceSymLink(symSrc, symTarget)
                return fname
        raise Exception('could not find unique log file name; exhausted counter at 9999')
    else:
        return expandVal(fnameTemplate, env)
Пример #4
0
def _findUniqueFileAndSetSymLink(fnameTemplate, env):
    if re.search(UNIQUE_REGEX, fnameTemplate):
        for i in xrange(0, 10000):
            uniqStr = '%s-%d' % (getFileNameTimeString(), i)
            fname = _expandUniq(fnameTemplate, uniqStr, env)
            if not os.path.exists(fname):
                symSrc = os.path.basename(fname)
                symTarget = _expandUniq(fnameTemplate, 'latest', env)
                _forceSymLink(symSrc, symTarget)
                return fname
        raise Exception(
            'could not find unique log file name; exhausted counter at 9999')
    else:
        return expandVal(fnameTemplate, env)
Пример #5
0
def _expandUniq(fname, counterStr, env):
    fnameWithUniq = re.sub(UNIQUE_REGEX, counterStr, fname)
    return expandVal(fnameWithUniq, env)
Пример #6
0
def _expandUniq(fname, counterStr, env):
    fnameWithUniq = re.sub(UNIQUE_REGEX, counterStr, fname)
    return expandVal(fnameWithUniq, env)