(self, args:cmd2.Statement)
| 72 | return completions |
| 73 | |
| 74 | def do_set(self, args:cmd2.Statement): |
| 75 | try: |
| 76 | section, option, value = None, None, None |
| 77 | if self._section is not None: |
| 78 | section = self._section |
| 79 | option = args.arg_list[0] |
| 80 | value = args.arg_list[1] if args.command == 'set' else None |
| 81 | else: |
| 82 | section = args.arg_list[0] |
| 83 | option = args.arg_list[1] |
| 84 | value = args.arg_list[2] if len(args.arg_list)>2 else None |
| 85 | if args.command == 'unset': |
| 86 | Settings.set_value(section, option, None) |
| 87 | elif args.command == 'set': |
| 88 | if section if self._section != section else option in self._config: |
| 89 | Settings.set_value(section, option, value) |
| 90 | else: |
| 91 | AnsiPrint.print_error(locale.get("errors.section_config_error").format(section=section)) |
| 92 | except Exception as e: |
| 93 | AnsiPrint.print_error(e) |
| 94 | |
| 95 | |
| 96 | def do_show(self, arg:cmd2.Statement): |
no test coverage detected