forked from esotericnonsense/bitcoind-ncurses
-
Notifications
You must be signed in to change notification settings - Fork 0
/
splash.py
42 lines (33 loc) · 1.41 KB
/
splash.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python
import curses
import global_mod as g
splash_array = [
" BB BB BB",
" BB BBBBB BB BBB BB BBBB BBBB BB BB BB BB",
" BBBBB BB BB BBB B BB BBB BB BB BB BBB BB BBBBB",
" BB BB BB BB BB BBBB BB BB BB BB BB BB BB BB",
" BB BBB BB BBB BB BB BB BB BB BB BB BB BB BB BBB",
" BBB BB BBB BB BB BB BB BBBB BBBB BB BB BB BBB BB",
]
def draw_window(state, window):
window.clear()
window.refresh()
win_splash = curses.newwin(12, 76, 0, 0)
color = curses.color_pair(2)
if 'testnet' in state:
if state['testnet']: color = curses.color_pair(3)
else: color = curses.color_pair(2)
y = 0
while y < len(splash_array):
x = 0
while x < len(splash_array[y]):
if splash_array[y][x] != " ":
win_splash.addstr(y+1, x, " ", color + curses.A_REVERSE)
x += 1
y += 1
output_string = " n c u r s e s "
win_splash.addstr(8, 0, output_string, color + curses.A_BOLD)
version = "[ " + g.version + " ]"
output_string = version.rjust(74)
win_splash.addstr(10, 0, output_string, curses.color_pair(3) + curses.A_BOLD)
win_splash.refresh()