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 None is returned. If the key isn't in the dictionary, then it will be added
(key, default=None)
| 23008 | |
| 23009 | |
| 23010 | def user_settings_get_entry(key, default=None): |
| 23011 | """ |
| 23012 | Returns the value of a specified setting. If the setting is not found in the settings dictionary, then |
| 23013 | the user specified default value will be returned. It no default is specified and nothing is found, then |
| 23014 | None is returned. If the key isn't in the dictionary, then it will be added and the settings file saved. |
| 23015 | If no filename has been specified up to this point, then a default filename will be assigned and used. |
| 23016 | The settings are SAVED prior to returning. |
| 23017 | |
| 23018 | :param key: Key used to lookup the setting in the settings dictionary |
| 23019 | :type key: (Any) |
| 23020 | :param default: Value to use should the key not be found in the dictionary |
| 23021 | :type default: (Any) |
| 23022 | :return: Value of specified settings |
| 23023 | :rtype: (Any) |
| 23024 | """ |
| 23025 | settings = UserSettings._default_for_function_interface |
| 23026 | return settings.get(key, default) |
| 23027 | |
| 23028 | |
| 23029 | def user_settings_save(filename=None, path=None): |
no test coverage detected