From 66ffb461a35a23b0ac79b1d70db9034dae4bb233 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 24 Sep 2011 23:53:39 +0200 Subject: slight changes to the settings 1. forbid to use the "set" type for the option "column_ratios", since order is relevant and a "set" does not preserve order. 2. add the function "regexp" in the :set command, so users can define regular expressions on the fly. --- ranger/container/settingobject.py | 2 +- ranger/defaults/commands.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ranger/container/settingobject.py b/ranger/container/settingobject.py index d036245f..6b6fbae7 100644 --- a/ranger/container/settingobject.py +++ b/ranger/container/settingobject.py @@ -22,7 +22,7 @@ ALLOWED_SETTINGS = { 'collapse_preview': bool, 'colorscheme_overlay': (type(None), type(lambda:0)), 'colorscheme': str, - 'column_ratios': (tuple, list, set), + 'column_ratios': (tuple, list), 'dirname_in_tabs': bool, 'display_size_in_main_column': bool, 'display_size_in_status_bar': bool, diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py index ad3fa0e5..8ab9b353 100644 --- a/ranger/defaults/commands.py +++ b/ranger/defaults/commands.py @@ -356,6 +356,7 @@ class set_(Command): name = line.chunk(1) name, value, _ = line.parse_setting_line() if name and value: + from re import compile as regexp try: value = eval(value) except: -- cgit 1.4.1-2-gfad0