예제 #1
0
    def test_interrupt(self):
        """
        CAN WE CATCH A SIGINT?
        """
        p = Process("not much" ["python", "tests/resources/utils/wait_for_signal.py"])
        k = Process("killer", ["kill", "-SIGINT", p.pid])

        p.join()
예제 #2
0
def get_git_revision():
    """
    GET THE CURRENT GIT REVISION
    """
    proc = Process("git log", ["git", "log", "-1"])

    try:
        while True:
            line = proc.stdout.pop().strip()
            if not line:
                continue
            if line.startswith("commit "):
                return line[7:]
    finally:
        with suppress_exception:
            proc.join()
예제 #3
0
파일: git.py 프로젝트: davehunt/ActiveData
def get_git_revision():
    """
    GET THE CURRENT GIT REVISION
    """
    proc = Process("git log", ["git", "log", "-1"])

    try:
        while True:
            line = proc.stdout.pop().strip()
            if not line:
                continue
            if line.startswith("commit "):
                return line[7:]
    finally:
        with suppress_exception:
            proc.join()
예제 #4
0
    def run_job(self, job):
        process = Process(name=job.name,
                          params=job.command,
                          cwd=job.directory,
                          env=job.environment)

        # DIRECT OUTPUT TO FILES
        self.add_file(
            process.stdout,
            coalesce(job.stdout,
                     File.newInstance(self.settings.log.directory, job.name)))
예제 #5
0
def get_remote_revision(url, branch):
    """
    GET REVISION OF A REMOTE BRANCH
    """

    proc = Process("git remote revision", ["git", "ls-remote", url, "refs/heads/" + branch])

    try:
        while True:
            line = proc.stdout.pop().strip()
            if not line:
                continue
            return line.split("\t")[0]
    finally:
        try:
            proc.join()
        except Exception:
            pass

    return None
예제 #6
0
파일: git.py 프로젝트: davehunt/ActiveData
def get_remote_revision(url, branch):
    """
    GET REVISION OF A REMOTE BRANCH
    """

    proc = Process("git remote revision",
                   ["git", "ls-remote", url, "refs/heads/" + branch])

    try:
        while True:
            line = proc.stdout.pop().strip()
            if not line:
                continue
            return line.split("\t")[0]
    finally:
        try:
            proc.join()
        except Exception:
            pass

    return None