diff options
Diffstat (limited to 'ranger/colorschemes/__init__.py')
-rw-r--r-- | ranger/colorschemes/__init__.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ranger/colorschemes/__init__.py b/ranger/colorschemes/__init__.py new file mode 100644 index 00000000..6319fa96 --- /dev/null +++ b/ranger/colorschemes/__init__.py @@ -0,0 +1,22 @@ +from ranger.helper import get_all, log +from os.path import expanduser, dirname, exists, join + +__all__ = get_all(dirname(__file__)) + +from ranger.colorschemes import * + +confpath = expanduser('~/.ranger') +if exists(join(confpath, 'colorschemes')): + initpy = join(confpath, 'colorschemes/__init__.py') + if not exists(initpy): + open(initpy, 'w').write("""import ranger.helper, os.path +__all__ = ranger.helper.get_all( os.path.dirname( __file__ ) ) +""") + + try: + import sys + sys.path[0:0] = [confpath] + from colorschemes import * + except ImportError: + pass + |