From 7eaa09dfbd29f7b3cace4792648f87d9950d45ff Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 29 Mar 2010 02:15:59 +0200 Subject: fixed --clean, which was violated in ranger.shared.settings --- ranger/shared/settings.py | 15 +++++++++------ 1 file 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' -- cgit 1.4.1-2-gfad0