fix pull request 2
authorOrakaro <nhatminh_179@hotmail.com>
Thu, 3 Jul 2014 23:45:28 +0000 (08:45 +0900)
committerOrakaro <nhatminh_179@hotmail.com>
Thu, 3 Jul 2014 23:45:28 +0000 (08:45 +0900)
.gitignore
rainbowstream/config.py
rainbowstream/draw.py
rainbowstream/rainbow.py

index 877f42349abb40216b676dc13b0c311c4a103eeb..fc1666b1a91a97f70282c8c9b92e36e97830bf6a 100644 (file)
@@ -54,3 +54,13 @@ docs/_build/
 
 # DB files
 *.db
+
+# Editor
+*sublime*
+.tag*
+
+# Virtualenv
+/venv/*
+
+# History completer
+completer.hist
\ No newline at end of file
index a5e542d5afcd492338ae2ea7f568b5ff2c4d5c2e..bc541a9297570e6f38a03dd9da4e1241ca4b98ad 100644 (file)
@@ -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]
index 2fbe51de6336ecbf36ce2375d47ee9dd0142549d..27cc8746865e784f97d0bace7289831c9f734423 100644 (file)
@@ -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:
index 6b88c501c8dcd109c7ac000516f62f6751c91c97..98aa05fba3da2a6c2531ea10c9e6057b641dcfcb 100644 (file)
@@ -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(