~sylvain-pineau/checkbox/fix-1220098

« back to all changes in this revision

Viewing changes to plainbox/plainbox/impl/commands/run.py

  • Committer: Sylvain Pineau
  • Date: 2013-12-17 14:55:14 UTC
  • Revision ID: sylvain.pineau@canonical.com-20131217145514-sfesa5vq8cp6ubes
plainbox:commands:run: check and use description interpolation

Show diffs side-by-side

added added

removed removed

Lines of Context:
332
332
 
333
333
    def _run_single_job_with_session(self, ns, session, runner, job):
334
334
        print("[ {} ]".format(job.name).center(80, '-'))
335
 
        if job.description is not None:
 
335
        if job.description is not None and not job.requires_interpolation:
336
336
            print(job.description)
337
337
            print("^" * len(job.description.splitlines()[-1]))
338
338
            print()
353
353
            session.persistent_save()
354
354
            # TODO: get a confirmation from the user for certain types of job.plugin
355
355
            job_result = runner.run_job(job)
 
356
            # XXX: What if the command failed? should we display for example
 
357
            # the full python traceback?
 
358
            if job.description is not None and job.requires_interpolation:
 
359
                new_description = job.get_interpolated_description(job_result)
 
360
                print(new_description)
 
361
                print("^" * len(new_description.splitlines()[-1]))
 
362
                print()
356
363
            if (job_result.outcome == IJobResult.OUTCOME_UNDECIDED
357
364
                    and self.is_interactive):
358
365
                job_result = self._interaction_callback(