summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-09-24 23:53:39 +0200
committerhut <hut@lavabit.com>2011-09-24 23:53:39 +0200
commit66ffb461a35a23b0ac79b1d70db9034dae4bb233 (patch)
treecc0009ec3c4549fbfd271045571c9b8e5c4e4cae
parent951afe4b3e9142e9a0ac772f2dd537fee7deca20 (diff)
downloadranger-66ffb461a35a23b0ac79b1d70db9034dae4bb233.tar.gz
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.
-rw-r--r--ranger/container/settingobject.py2
-rw-r--r--ranger/defaults/commands.py1
2 files changed, 2 insertions, 1 deletions
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: