# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com>
# This software is distributed under the terms of the GNU GPL version 3.
from inspect import isfunction
from ranger.ext.signals import SignalDispatcher
from ranger.core.shared import FileManagerAware
import re
ALLOWED_SETTINGS = {
'autosave_bookmarks': bool,
'autoupdate_cumulative_size': bool,
'collapse_preview': bool,
'colorscheme': str,
'column_ratios': (tuple, list),
'dirname_in_tabs': bool,
'display_size_in_main_column': bool,
'display_size_in_status_bar': bool,
'display_tags_in_all_columns': bool,
'draw_borders': bool,
'draw_progress_bar_in_status_bar': bool,
'flushinput': bool,
'hidden_filter': (str, type(re.compile(""))), #COMPAT change to str-only
'max_console_history_size': (int, type(None)),
'max_history_size': (int, type(None)),
'mouse_enabled': bool,
'padding_right': bool,
'preview_directories': bool,
'preview_files': bool,
'preview_script': (str, type(None)),
'save_console_history': bool,
'scroll_offset': int,
'shorten_title': int, # XXX Note: False is an instance of int
'show_cursor': bool,
'show_hidden_bookmarks': bool,
'show_hidden': bool,
'sort_case_insensitive': bool,
'sort_directories_first': bool,
'sort_reverse': bool,
'sort':