Ejemplo n.º 1
0
def change_mode(state, window, mode, rpc_queue=None):
    try:
        g.modes.index(mode)
    except ValueError:
        return False

    state['mode'] = mode

    if mode == 'home':
        monitor.draw_window(state, window, rpc_queue)
    elif mode == 'tx':
        tx.draw_window(state, window, rpc_queue)
    elif mode == 'peers':
        peers.draw_window(state, window, rpc_queue)
    elif mode == 'wallet':
        wallet.draw_window(state, window, rpc_queue)
    elif mode == 'mempool':
        mempool.draw_window(state, window, rpc_queue)
    elif mode == 'block':
        block.draw_window(state, window, rpc_queue)
    elif mode == 'console':
        console.draw_window(state, window, rpc_queue)
    elif mode == 'net':
        net.draw_window(state, window, rpc_queue)
    elif mode == 'forks':
        forks.draw_window(state, window, rpc_queue)
Ejemplo n.º 2
0
def change_mode(block_viewer, state, window, mode, poller):
    try:
        g.modes.index(mode)
    except ValueError:
        return False

    state['mode'] = mode
    block_viewer._mode = mode

    if mode == 'monitor':
        monitor.draw_window(state, window)
    elif mode == 'tx':
        tx.draw_window(state, window)
    elif mode == 'peers':
        peers.draw_window(state, window)
    elif mode == 'wallet':
        wallet.draw_window(state, window)
    elif mode == 'block':
        block_viewer.draw()
    elif mode == 'console':
        console.draw_window(state, window)
    elif mode == 'net':
        net.draw_window(state, window)
    elif mode == 'forks':
        forks.draw_window(state, window)

    footer.draw_window(state)
    poller.set_mode(mode)
Ejemplo n.º 3
0
def change_mode(block_viewer, state, window, mode, poller):
    try:
        g.modes.index(mode)
    except ValueError:
        return False

    state['mode'] = mode
    block_viewer._mode = mode

    if mode == 'monitor':
        monitor.draw_window(state, window)
    elif mode == 'tx':
        tx.draw_window(state, window)
    elif mode == 'peers':
        peers.draw_window(state, window)
    elif mode == 'wallet':
        wallet.draw_window(state, window)
    elif mode == 'block':
        block_viewer.draw()
    elif mode == 'console':
        console.draw_window(state, window)
    elif mode == 'net':
        net.draw_window(state, window)
    elif mode == 'forks':
        forks.draw_window(state, window)

    footer.draw_window(state)
    poller.set_mode(mode)
Ejemplo n.º 4
0
def change_mode(state, window, mode):
    try:
        g.modes.index(mode)
    except ValueError:
        return False

    state['mode'] = mode

    if mode == 'overview':
        monitor.draw_window(state, window)
    elif mode == 'tx':
        tx.draw_window(state, window)
    elif mode == 'peers':
        peers.draw_window(state, window)
    elif mode == 'wallet':
        wallet.draw_window(state, window)
    elif mode == 'block':
        block.draw_window(state, window)
    elif mode == 'console':
        console.draw_window(state, window)
    elif mode == 'net':
        net.draw_window(state, window)
    elif mode == 'forks':
        forks.draw_window(state, window)
    elif mode == 'mnodes':
        mnode.draw_window(state, window)
Ejemplo n.º 5
0
def resize(s, state, window, rpc_queue):
    if state['mode'] == 'tx':
        tx.draw_window(state, window, rpc_queue)
    elif state['mode'] == 'block':
        block.draw_window(state, window, rpc_queue)
    elif state['mode'] == 'peers':
        peers.draw_window(state, window, rpc_queue)
    elif state['mode'] == 'wallet':
        wallet.draw_window(state, window, rpc_queue)
    elif state['mode'] == 'monitor':
        monitor.draw_window(state, window, rpc_queue)
    elif state['mode'] == 'console':
        console.draw_window(state, window, rpc_queue)
    elif state['mode'] == 'net':
        net.draw_window(state, window, rpc_queue)
    elif state['mode'] == 'forks':
        forks.draw_window(state, window, rpc_queue)
Ejemplo n.º 6
0
def resize(s, state, window):
    if state['mode'] == 'tx':
        tx.draw_window(state, window)
    elif state['mode'] == 'block':
        block.draw_window(state, window)
    elif state['mode'] == 'peers':
        peers.draw_window(state, window)
    elif state['mode'] == 'wallet':
        wallet.draw_window(state, window)
    elif state['mode'] == 'overview':
        monitor.draw_window(state, window)
    elif state['mode'] == 'console':
        console.draw_window(state, window)
    elif state['mode'] == 'net':
        net.draw_window(state, window)
    elif state['mode'] == 'forks':
        forks.draw_window(state, window)
    elif state['mode'] == 'mnodes':
        mnode.draw_window(state, window)
Ejemplo n.º 7
0
def resize(s, state, window, rpc_queue):
    if state['mode'] == 'tx':
        tx.draw_window(state, window, rpc_queue)
    elif state['mode'] == 'block':
        block.draw_window(state, window, rpc_queue)
    elif state['mode'] == 'mempool':
        mempool.draw_window(state, window, rpc_queue)
    elif state['mode'] == 'peers':
        peers.draw_window(state, window, rpc_queue)
    elif state['mode'] == 'wallet':
        wallet.draw_window(state, window, rpc_queue)
    elif state['mode'] == 'home':
        monitor.draw_window(state, window, rpc_queue)
    elif state['mode'] == 'console':
        console.draw_window(state, window, rpc_queue)
    elif state['mode'] == 'net':
        net.draw_window(state, window, rpc_queue)
    elif state['mode'] == 'forks':
        forks.draw_window(state, window, rpc_queue)
Ejemplo n.º 8
0
def getchaintips(s, state, window):
    state['chaintips'] = s['getchaintips']
    state['chaintips_offset'] = 0
    if state['mode'] == 'forks':
        forks.draw_window(state, window)
Ejemplo n.º 9
0
def getchaintips(s, state, window):
    state['chaintips'] = s['getchaintips']
    state['chaintips_offset'] = 0
    if state['mode'] == 'forks':
        forks.draw_window(state, window)
        footer.draw_window(state)
Ejemplo n.º 10
0
def getchaintips(s, state, window, rpc_queue):
    state['chaintips'] = s['getchaintips']
    state['chaintips_offset'] = 0
    if state['mode'] == 'forks':
        forks.draw_window(state, window, rpc_queue)