summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-04-26 00:41:15 +0200
committerhut <hut@lavabit.com>2010-04-26 00:41:15 +0200
commitdf031abce3bd8cf9a31815b1e7bf148dde7ed69e (patch)
treec633a8121698cb1212c1b99f2049a9874a2e6fc4 /ranger
parent9e0e9fd34cc012dc03f85e5274e171717b128bc9 (diff)
downloadranger-df031abce3bd8cf9a31815b1e7bf148dde7ed69e.tar.gz
gui.colorscheme: fixed error when using custom colorschemes
Diffstat (limited to 'ranger')
-rw-r--r--ranger/gui/colorscheme.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ranger/gui/colorscheme.py b/ranger/gui/colorscheme.py
index 8c81763f..501b8788 100644
--- a/ranger/gui/colorscheme.py
+++ b/ranger/gui/colorscheme.py
@@ -47,6 +47,7 @@ from curses import color_pair
 import ranger
 from ranger.gui.color import get_color
 from ranger.gui.context import Context
+from ranger.__main__ import allow_access_to_confdir
 from ranger.shared.settings import SettingsAware
 
 # ColorScheme is not SettingsAware but it will gain access
@@ -150,6 +151,7 @@ def _colorscheme_name_to_class(signal):
 		scheme_supermodule = 'colorschemes'
 	elif exists(ranger.relpath('colorschemes', scheme_name)):
 		scheme_supermodule = 'ranger.colorschemes'
+		usecustom = False
 	else:
 		scheme_supermodule = None  # found no matching file.
 
@@ -160,8 +162,10 @@ def _colorscheme_name_to_class(signal):
 			raise Exception("Cannot locate colorscheme!")
 		signal.value = ColorScheme()
 	else:
+		if usecustom: allow_access_to_confdir(ranger.arg.confdir, True)
 		scheme_module = getattr(__import__(scheme_supermodule,
 				globals(), locals(), [scheme_name], 0), scheme_name)
+		if usecustom: allow_access_to_confdir(ranger.arg.confdir, False)
 		if hasattr(scheme_module, 'Scheme') \
 				and is_scheme(scheme_module.Scheme):
 			signal.value = scheme_module.Scheme()