summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-03-29 02:15:59 +0200
committerhut <hut@lavabit.com>2010-03-29 02:15:59 +0200
commit7eaa09dfbd29f7b3cace4792648f87d9950d45ff (patch)
tree42c59819b85c996c843967da801e6d7bc3a9a46e
parentf5e9c01ec9f092366bd7de2ec5be973b312ed159 (diff)
downloadranger-7eaa09dfbd29f7b3cace4792648f87d9950d45ff.tar.gz
fixed --clean, which was violated in ranger.shared.settings
-rw-r--r--ranger/shared/settings.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/ranger/shared/settings.py b/ranger/shared/settings.py
index 88c2dfb3..debe816d 100644
--- a/ranger/shared/settings.py
+++ b/ranger/shared/settings.py
@@ -97,6 +97,7 @@ class SettingsAware(object):
 		# is picked.
 
 		scheme_name = settings.colorscheme
+		usecustom = not ranger.arg.clean
 
 		def exists(colorscheme):
 			return os.path.exists(colorscheme + '.py')
@@ -105,12 +106,14 @@ class SettingsAware(object):
 			return isclass(x) and issubclass(x, ColorScheme)
 
 		# create ~/.ranger/colorschemes/__init__.py if it doesn't exist
-		if os.path.exists(ranger.relpath_conf('colorschemes')):
-			initpy = ranger.relpath_conf('colorschemes', '__init__.py')
-			if not os.path.exists(initpy):
-				open(initpy, 'a').close()
-
-		if exists(ranger.relpath_conf('colorschemes', scheme_name)):
+		if usecustom:
+			if os.path.exists(ranger.relpath_conf('colorschemes')):
+				initpy = ranger.relpath_conf('colorschemes', '__init__.py')
+				if not os.path.exists(initpy):
+					open(initpy, 'a').close()
+
+		if usecustom and \
+				exists(ranger.relpath_conf('colorschemes', scheme_name)):
 			scheme_supermodule = 'colorschemes'
 		elif exists(ranger.relpath('colorschemes', scheme_name)):
 			scheme_supermodule = 'ranger.colorschemes'