From 15f3e155c73e02226da9d236e219e79e3ca87472 Mon Sep 17 00:00:00 2001 From: Orakaro Date: Fri, 4 Jul 2014 08:45:28 +0900 Subject: [PATCH] fix pull request 2 --- .gitignore | 10 ++++++++++ rainbowstream/config.py | 2 +- rainbowstream/draw.py | 2 +- rainbowstream/rainbow.py | 4 ++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 877f423..fc1666b 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,13 @@ docs/_build/ # DB files *.db + +# Editor +*sublime* +.tag* + +# Virtualenv +/venv/* + +# History completer +completer.hist \ No newline at end of file diff --git a/rainbowstream/config.py b/rainbowstream/config.py index a5e542d..bc541a9 100644 --- a/rainbowstream/config.py +++ b/rainbowstream/config.py @@ -25,7 +25,7 @@ def load_config(filepath): # Load default colorset c = {} -default_config = 'rainbowstream/colorset/default.json' +default_config = os.path.dirname(__file__) + '/colorset/default.json' data = load_config(default_config) for d in data: c[d] = data[d] diff --git a/rainbowstream/draw.py b/rainbowstream/draw.py index 2fbe51d..27cc874 100644 --- a/rainbowstream/draw.py +++ b/rainbowstream/draw.py @@ -101,7 +101,7 @@ def check_theme(): os.environ.get('USERPROFILE', '')) + os.sep + '.rainbow_config.json' else: - config = 'rainbowstream/colorset/'+c['theme']+'.json' + config = os.path.dirname(__file__) + '/colorset/'+c['theme']+'.json' # Load new config data = load_config(config) if data: diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index 6b88c50..98aa05f 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -137,7 +137,7 @@ def get_decorated_name(): g['decorated_name'] = color_func(c['DECORATED_NAME'])('[' + name + ']: ') g['ascii_art'] = True - files = os.listdir('rainbowstream/colorset') + files = os.listdir(os.path.dirname(__file__)+'/colorset') themes = [f.split('.')[0] for f in files if f.split('.')[-1] == 'json'] themes += ['custom'] g['themes'] = themes @@ -795,7 +795,7 @@ def theme(): try: # Load new config if g['stuff'] != 'custom': - new_config = 'rainbowstream/colorset/' + g['stuff'] + '.json' + new_config = os.path.dirname(__file__) + '/colorset/' + g['stuff'] + '.json' else: new_config = os.environ.get( 'HOME',os.environ.get( -- 2.25.1