def run_local_mode(self):
        """
        Runs this module in local mode.
        At this point arguments from cmd where parsed and converted.
        We create command arguments and prepare threads.

        If we need to run multiple jobs (for example cpu specification required
        to run this command using 1 AND 2 CPU) we call method run_local_mode_one
        repeatedly otherwise only once
        :rtype: PyPy
        """
        total = len(self.proc)
        result = ResultHolder()

        if total == 1:
            pypy = self.run_local_mode_one(self.proc[0])
            result.add(pypy)
        else:
            # optionally we use counter
            progress = ProgressCounter('Running {:02d} of {total:02d}')
            for p in self.proc:
                progress.next(locals())
                Printer.all.sep()

                with Printer.all.with_level():
                    pypy = self.run_local_mode_one(p)
                result.add(pypy)
                Printer.all.sep()

        return result.singlify()
    def run_local_mode(self):
        """
        Runs this module in local mode.
        At this point arguments from cmd where parsed and converted.
        We create command arguments and prepare threads.

        If we need to run multiple jobs (for example cpu specification required
        to run this command using 1 AND 2 CPU) we call method run_local_mode_one
        repeatedly otherwise only once
        :rtype: PyPy
        """
        total = len(self.proc)
        result = ResultHolder()

        if total == 1:
            pypy = self.run_local_mode_one(self.proc[0])
            result.add(pypy)
        else:
            # optionally we use counter
            progress = ProgressCounter('Running {:02d} of {total:02d}')
            for p in self.proc:
                progress.next(locals())
                Printer.all.sep()

                with Printer.all.with_level():
                    pypy = self.run_local_mode_one(p)
                result.add(pypy)
                Printer.all.sep()

        return result.singlify()
 def run(self):
     Printer.all.sep()
     Printer.all.out("Collecting artifacts...")
     Printer.all.sep()
     counter = ProgressCounter('Artifact step {:02d} / {total:02d}: {step}')
     total = len(self.steps)
     with Printer.all.with_level(1):
         for step in self.steps:
             counter.next(locals())
             with Printer.all.with_level(1):
                 step.run()
     Printer.all.sep()
示例#4
0
 def run(self):
     Printer.all.sep()
     Printer.all.out("Collecting artifacts...")
     Printer.all.sep()
     counter = ProgressCounter("Artifact step {:02d} / {total:02d}: {step}")
     total = len(self.steps)
     with Printer.all.with_level(1):
         for step in self.steps:
             counter.next(locals())
             with Printer.all.with_level(1):
                 step.run()
     Printer.all.sep()
def run_local_mode(debug=False):
    global arg_options, arg_others, arg_rest
    proc, time_limit, memory_limit = get_args()
    total = len(proc)

    if total == 1:
        pypy = run_local_mode_one(proc[0], time_limit, memory_limit)
        GlobalResult.returncode = pypy.returncode
    else:
        # optionally we use counter
        progress = ProgressCounter('Running {:02d} of {total:02d}')
        for p in proc:
            Printer.separator()
            progress.next(locals())
            Printer.separator()

            Printer.open()
            pypy = run_local_mode_one(p, time_limit, memory_limit)
            Printer.close()
            GlobalResult.returncode = max(GlobalResult.returncode, pypy.returncode)

    return GlobalResult.returncode if not debug else pypy