Returns the value of a specified setting. If the setting is not found in the settings dictionary, then the user specified default value will be returned. It no default is specified and nothing is found, then the "default value" is returned. This default can be specified i
(self, key, default=None)
| 22842 | return value |
| 22843 | |
| 22844 | def get(self, key, default=None): |
| 22845 | """ |
| 22846 | Returns the value of a specified setting. If the setting is not found in the settings dictionary, then |
| 22847 | the user specified default value will be returned. It no default is specified and nothing is found, then |
| 22848 | the "default value" is returned. This default can be specified in this call, or previously defined |
| 22849 | by calling set_default. If nothing specified now or previously, then None is returned as default. |
| 22850 | |
| 22851 | :param key: Key used to lookup the setting in the settings dictionary |
| 22852 | :type key: (Any) |
| 22853 | :param default: Value to use should the key not be found in the dictionary |
| 22854 | :type default: (Any) |
| 22855 | :return: Value of specified settings |
| 22856 | :rtype: (Any) |
| 22857 | """ |
| 22858 | if self.default_value is not None: |
| 22859 | default = self.default_value |
| 22860 | |
| 22861 | if self.full_filename is None: |
| 22862 | self.set_location() |
| 22863 | if self.autosave or self.dict == {}: |
| 22864 | self.read() |
| 22865 | if not self.use_config_file: |
| 22866 | value = self.dict.get(key, default) |
| 22867 | else: |
| 22868 | value = self.section_class_dict.get(key, None) |
| 22869 | if key not in list(self.section_class_dict.keys()): |
| 22870 | self.section_class_dict[key] = self._SectionDict(key, {}, self.config, self) |
| 22871 | value = self.section_class_dict[key] |
| 22872 | value.new_section = True |
| 22873 | return value |
| 22874 | |
| 22875 | def get_dict(self): |
| 22876 | """ |
no test coverage detected