From 2e74a4d016849eede5b3cb9200aa93bf930d5298 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 10 Oct 2010 02:35:23 +0200 Subject: gui.colorscheme: polished up (docs, error handling) --- ranger/gui/colorscheme.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ranger/gui/colorscheme.py b/ranger/gui/colorscheme.py index ae6aac0b..1fa23656 100644 --- a/ranger/gui/colorscheme.py +++ b/ranger/gui/colorscheme.py @@ -35,10 +35,7 @@ associated with either True or False. define which colorscheme to use by having this to your options.py: from ranger import colorschemes -colorscheme = colorschemes.filename - -If your colorscheme-file contains more than one colorscheme, specify it with: -colorscheme = colorschemes.filename.classname +colorscheme = "name" """ import os @@ -121,7 +118,7 @@ class ColorScheme(SettingsAware): return fg, -1, attr def _colorscheme_name_to_class(signal): - # Find the colorscheme. First look for it at ~/.config/ranger/colorschemes, + # Find the colorscheme. First look in ~/.config/ranger/colorschemes, # then at RANGERDIR/colorschemes. If the file contains a class # named Scheme, it is used. Otherwise, an arbitrary other class # is picked. @@ -156,11 +153,11 @@ def _colorscheme_name_to_class(signal): scheme_supermodule = None # found no matching file. if scheme_supermodule is None: - # XXX: dont print while curses is running - print("ERROR: colorscheme not found, fall back to builtin scheme") - if ranger.arg.debug: - raise Exception("Cannot locate colorscheme!") - signal.value = ColorScheme() + if signal.previous and isinstance(signal.previous, ColorScheme): + signal.value = signal.previous + else: + signal.value = ColorScheme() + raise Exception("Cannot locate colorscheme `%s'" % scheme_name) else: if usecustom: allow_access_to_confdir(ranger.arg.confdir, True) scheme_module = getattr(__import__(scheme_supermodule, -- cgit 1.4.1-2-gfad0 rep'>log msg
path: root/README.md
blob: ce7537e7243be599d6b4722d665852c3a2c0d208 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15