summary refs log tree commit diff stats
path: root/ranger/colorschemes/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/colorschemes/__init__.py')
-rw-r--r--ranger/colorschemes/__init__.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/ranger/colorschemes/__init__.py b/ranger/colorschemes/__init__.py
index ed5413d8..422c6598 100644
--- a/ranger/colorschemes/__init__.py
+++ b/ranger/colorschemes/__init__.py
@@ -22,22 +22,15 @@ from os.path import expanduser, dirname, exists, join
 
 __all__ = get_all_modules(dirname(__file__))
 
-from ranger.colorschemes import *
-from ranger import relpath_conf
-
-if exists(relpath_conf('colorschemes')):
-	initpy = relpath_conf('colorschemes', '__init__.py')
-	if not exists(initpy):
-		open(initpy, 'w').write("""# Automatically generated:
+if not ranger.arg.clean:
+	if exists(ranger.relpath_conf('colorschemes')):
+		initpy = ranger.relpath_conf('colorschemes', '__init__.py')
+		if not exists(initpy):
+			open(initpy, 'w').write("""# Automatically generated:
 from ranger.ext.get_all_modules import get_all_modules
 from os.path import dirname
 
 __all__ = get_all_modules(dirname(__file__))
 """)
 
-	try:
-		import sys
-		sys.path[0:0] = [ranger.CONFDIR]
-		from colorschemes import *
-	except ImportError:
-		pass
+from ranger.colorschemes import *