Beispiel #1
0
 def main(self, argv):
     if not argv:
         self.parser.error("too few arguments.")
     args = self._parse_args(argv)
     proj = Project.selected()
     targ, app, meas, expr = self._parse_implicit(args)
     expr = self._parse_explicit_experiment(args, expr)
     if expr:
         targ, app, meas = None, None, None
         name = expr['name']
     else:
         targ = self._parse_explicit(args, Target, targ, proj, 'targets')
         app = self._parse_explicit(args, Application, app, proj, 'applications')
         meas = self._parse_explicit(args, Measurement, meas, proj, 'measurements')
         name = getattr(args, 'name', "%s-%s-%s" % (targ['name'], app['name'], meas['name']))
     try:
         Experiment.select(name)
     except ExperimentSelectionError:
         args = [name,
                 '--target', targ['name'],
                 '--application', app['name'],
                 '--measurement', meas['name']]
         retval = experiment_create_cmd.main(args)
         if retval != EXIT_SUCCESS:
             return retval
         Experiment.select(name)
     self.logger.info("Selected experiment '%s'.", name)
     rebuild_required = Experiment.rebuild_required()
     if rebuild_required: 
         self.logger.info(rebuild_required)
     return EXIT_SUCCESS
Beispiel #2
0
 def main(self, argv):
     if not argv:
         self.parser.error("too few arguments.")
     args = self._parse_args(argv)
     proj = Project.selected()
     targ, app, meas, expr = self._parse_implicit(args)
     expr = self._parse_explicit_experiment(args, expr)
     if expr:
         targ, app, meas = None, None, None
         name = expr['name']
     else:
         targ = self._parse_explicit(args, Target, targ, proj, 'targets')
         app = self._parse_explicit(args, Application, app, proj,
                                    'applications')
         meas = self._parse_explicit(args, Measurement, meas, proj,
                                     'measurements')
         name = getattr(
             args, 'name',
             "%s-%s-%s" % (targ['name'], app['name'], meas['name']))
     try:
         Experiment.select(name)
     except ExperimentSelectionError:
         args = [
             name, '--target', targ['name'], '--application', app['name'],
             '--measurement', meas['name']
         ]
         retval = experiment_create_cmd.main(args)
         if retval != EXIT_SUCCESS:
             return retval
         Experiment.select(name)
     self.logger.info("Selected experiment '%s'.", name)
     rebuild_required = Experiment.rebuild_required()
     if rebuild_required:
         self.logger.info(rebuild_required)
     return EXIT_SUCCESS
Beispiel #3
0
 def main(self, argv):
     args = self._parse_args(argv)
     name = args.name
     Experiment.select(name)
     self.logger.info("Selected experiment '%s'.", name)
     rebuild_required = Experiment.rebuild_required()
     if rebuild_required:
         self.logger.info(rebuild_required)
     return EXIT_SUCCESS
Beispiel #4
0
 def _update_record(self, store, data, key):
     try:
         retval = super(ApplicationEditCommand, self)._update_record(store, data, key)
     except (ImmutableRecordError, IncompatibleRecordError) as err:
         err.hints = ["Use `%s` to create a modified copy of the application" % application_copy_cmd,
                      "Use `%s` to delete the experiments." % experiment_delete_cmd]
         raise err
     if not retval:
         rebuild_required = Experiment.rebuild_required()
         if rebuild_required: 
             self.logger.info(rebuild_required)
     return retval       
Beispiel #5
0
 def _update_record(self, store, data, key):
     try:
         retval = super(MeasurementEditCommand, self)._update_record(store, data, key)
     except (ImmutableRecordError, IncompatibleRecordError) as err:
         err.hints = ["Use `%s` to create a modified copy of the measurement" % measurement_copy_cmd,
                      "Use `%s` to delete the experiments." % experiment_delete_cmd]
         raise err
     if not retval:
         rebuild_required = Experiment.rebuild_required()
         if rebuild_required: 
             self.logger.info(rebuild_required)
     return retval       
Beispiel #6
0
 def _update_record(self, store, data, key):
     from taucmdr.cli.commands.target.copy import COMMAND as target_copy_cmd
     from taucmdr.cli.commands.experiment.delete import COMMAND as experiment_delete_cmd
     try:
         retval = super(TargetEditCommand, self)._update_record(store, data, key)
     except (ImmutableRecordError, IncompatibleRecordError) as err:
         err.hints = ["Use `%s` to create a modified copy of the target" % target_copy_cmd,
                      "Use `%s` to delete the experiments." % experiment_delete_cmd]
         raise err
     if not retval:
         rebuild_required = Experiment.rebuild_required()
         if rebuild_required: 
             self.logger.info(rebuild_required)
     return retval
Beispiel #7
0
 def _update_record(self, store, data, key):
     from taucmdr.cli.commands.target.copy import COMMAND as target_copy_cmd
     from taucmdr.cli.commands.experiment.delete import COMMAND as experiment_delete_cmd
     try:
         retval = super(TargetEditCommand,
                        self)._update_record(store, data, key)
     except (ImmutableRecordError, IncompatibleRecordError) as err:
         err.hints = [
             "Use `%s` to create a modified copy of the target" %
             target_copy_cmd,
             "Use `%s` to delete the experiments." % experiment_delete_cmd
         ]
         raise err
     if not retval:
         rebuild_required = Experiment.rebuild_required()
         if rebuild_required:
             self.logger.info(rebuild_required)
     return retval