summary refs log tree commit diff stats
path: root/ranger/colorschemes/__init__.py
blob: 2318ba279173128e57af49426931f3579c75cbf4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from ranger 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, os.path
__all__ = ranger.get_all( os.path.dirname( __file__ ) )
""")

	try:
		import sys
		sys.path[0:0] = [confpath]
		from colorschemes import *
	except ImportError:
		pass