diff options
Diffstat (limited to 'ranger/shared/settings.py')
-rw-r--r-- | ranger/shared/settings.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ranger/shared/settings.py b/ranger/shared/settings.py index 9a8a0000..c5544a47 100644 --- a/ranger/shared/settings.py +++ b/ranger/shared/settings.py @@ -95,6 +95,18 @@ class SettingObject(SignalDispatcher): for x in self._settings: yield x + def types_of(self, name): + try: + typ = ALLOWED_SETTINGS[name] + except KeyError: + return tuple() + else: + if isinstance(typ, tuple): + return typ + else: + return (typ, ) + + def _check_type(self, name, value): from inspect import isfunction typ = ALLOWED_SETTINGS[name] |