Skip to content

Commit

Permalink
fixed cpu busy waiting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Aug 3, 2017
1 parent e9c3faa commit a616d9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cryptop/cryptop.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ def conf_scr():
text, banner, banner_text, background = get_theme_colors()
curses.init_pair(2, text, background)
curses.init_pair(3, banner_text, banner)
curses.halfdelay(10)


def write_scr(stdscr, wallet, y, x):
'''Write text and formatting to screen'''
if y >= 1:
stdscr.addnstr(0, 0, 'cryptop v0.1.3', x, curses.color_pair(2))
stdscr.addnstr(0, 0, 'cryptop v0.1.5', x, curses.color_pair(2))
if y >= 2:
header = ' COIN PRICE HELD VAL HIGH LOW '
stdscr.addnstr(1, 0, header, x, curses.color_pair(3))
Expand Down Expand Up @@ -136,7 +137,6 @@ def write_wallet(wallet):

def get_string(stdscr, prompt):
'''Requests and string from the user'''
stdscr.nodelay(0)
curses.echo()
stdscr.clear()
stdscr.addnstr(0, 0, prompt, -1, curses.color_pair(2))
Expand All @@ -146,7 +146,7 @@ def get_string(stdscr, prompt):
curses.noecho()
curses.curs_set(0)
stdscr.clear()
stdscr.nodelay(1)
curses.halfdelay(10)
return in_str


Expand Down Expand Up @@ -178,7 +178,7 @@ def mainc(stdscr):
conf_scr()
stdscr.bkgd(' ', curses.color_pair(2))
stdscr.clear()
stdscr.nodelay(1)
#stdscr.nodelay(1)
# while inp != 48 and inp != 27 and inp != 81 and inp != 113:
while inp not in {KEY_ZERO, KEY_ESCAPE, KEY_Q, KEY_q}:
while True:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='cryptop',
version='0.1.3',
version='0.1.5',
description='Command line Cryptocurrency Portfolio',
long_description=readme,
author='huwwp',
Expand Down

0 comments on commit a616d9f

Please sign in to comment.