Example #1
0
 def set_args(self, parsed_args):
     for arg in self._arg_class:
         try:
             value = parsed_args[arg.dest]
             logging.debug('Setting up %s=%s.', arg.dest, value)
             self.__setitem__(arg.dest, arg(value))
         except KeyError as exception:
             logging.debug(gen_exception_handling_log_msg(exception))
             logging.debug('Value for "%s" argument wasn\'t provided.',
                           arg.dest)
Example #2
0
 def common_int_param(self):
     try:
         return self.__getitem__(CommonIntParam.dest)
     except KeyError as exception:
         logging.debug(gen_exception_handling_log_msg(exception))
         raise NotSetError(f"{CommonIntParam.dest} hasn't been set")
Example #3
0
 def mode(self):
     try:
         return self.__getitem__(Mode.dest)
     except KeyError as exception:
         logging.debug(gen_exception_handling_log_msg(exception))
         raise NotSetError(f"{Mode.dest} hasn't been set")
Example #4
0
 def basic_param(self):
     try:
         return self.__getitem__(BasicParam.dest)
     except KeyError as exception:
         logging.debug(gen_exception_handling_log_msg(exception))
         raise NotSetError(f"{BasicParam.dest} hasn't been set")