diff options
Diffstat (limited to 'ranger/shared/settings.py')
-rw-r--r-- | ranger/shared/settings.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/ranger/shared/settings.py b/ranger/shared/settings.py index a4ca8df5..e53f31b0 100644 --- a/ranger/shared/settings.py +++ b/ranger/shared/settings.py @@ -28,9 +28,9 @@ ALLOWED_SETTINGS = { 'draw_borders': bool, 'draw_bookmark_borders': bool, 'sort': str, - 'reverse': bool, - 'case_insensitive': bool, - 'directories_first': bool, + 'sort_reverse': bool, + 'sort_case_insensitive': bool, + 'sort_directories_first': bool, 'update_title': bool, 'shorten_title': int, # Note: False is an instance of int 'max_filesize_for_preview': (int, type(None)), @@ -43,6 +43,11 @@ ALLOWED_SETTINGS = { 'hidden_filter': lambda x: isinstance(x, str) or hasattr(x, 'match'), } +COMPAT_MAP = { + 'sort_reverse': 'reverse', + 'sort_directories_first': 'directories_first', +} + # -- globalize the settings -- class SettingsAware(object): settings = OpenStruct() @@ -72,6 +77,15 @@ class SettingsAware(object): settings[setting] = getattr(my_options, setting) except AttributeError: pass + for new, old in COMPAT_MAP.items(): + try: + settings[new] = getattr(my_options, old) + print("Warning: the option `{0}'"\ + " was renamed to `{1}'\nPlease update"\ + " your configuration file soon." \ + .format(old, new)) + except AttributeError: + pass assert check_option_types(settings) |