projects
/
rainbowstream.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix docs
[rainbowstream.git]
/
rainbowstream
/
draw.py
diff --git
a/rainbowstream/draw.py
b/rainbowstream/draw.py
index a44450cc0486ea1188ae7ed640f1cde39c8d36a1..27cc8746865e784f97d0bace7289831c9f734423 100644
(file)
--- a/
rainbowstream/draw.py
+++ b/
rainbowstream/draw.py
@@
-24,13
+24,20
@@
def init_cycle():
Init the cycle
"""
colors_shuffle = [globals()[i.encode('utf8')]
Init the cycle
"""
colors_shuffle = [globals()[i.encode('utf8')]
- if not i.startswith('
RGB
_')
- else
RGB(int(i[4
:]))
+ if not i.startswith('
term
_')
+ else
term_color(int(i[5
:]))
for i in c['CYCLE_COLOR']]
return itertools.cycle(colors_shuffle)
g['cyc'] = init_cycle()
for i in c['CYCLE_COLOR']]
return itertools.cycle(colors_shuffle)
g['cyc'] = init_cycle()
+def notify_cycle():
+ """
+ Notify from rainbow
+ """
+ g['cyc'] = init_cycle()
+
+
def order_rainbow(s):
"""
Print a string with ordered color with each character
def order_rainbow(s):
"""
Print a string with ordered color with each character
@@
-94,7
+101,7
@@
def check_theme():
os.environ.get('USERPROFILE',
'')) + os.sep + '.rainbow_config.json'
else:
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:
# Load new config
data = load_config(config)
if data:
@@
-109,8
+116,8
@@
def color_func(func_name):
Call color function base on name
"""
pure = func_name.encode('utf8')
Call color function base on name
"""
pure = func_name.encode('utf8')
- if pure.startswith('
RGB_') and pure[4
:].isdigit():
- return
RGB(int(pure[4
:]))
+ if pure.startswith('
term_') and pure[5
:].isdigit():
+ return
term_color(int(pure[5
:]))
return globals()[pure]
return globals()[pure]