# Path: pigeon/xerblin/btree.py
# def get(node, key):
#     '''
#     Return the value stored under key or raise KeyError if not found.
#     '''
#     if not node:
#         raise KeyError, key
# 
#     node_key, value, lower, higher = node
# 
#     if key == node_key:
#         return value
# 
#     return get(lower if key < node_key else higher, key)


from Tkinter import (
    Text,
    Toplevel,
    TclError,
    END,
    INSERT,
    SEL,
    DISABLED,
    NORMAL,
    )
from time import time
from traceback import format_exc
from pigeon.xerblin.btree import get
    from pigeon.xerblin.btree import items
    from pigeon.xerblin.world import HistoryListWorld, view0
import re, os
        self.world = world

    def do_lookup(self, name):
        self.world.step(['"%s"' % (name,), 'lookup'])

    def do_opendoc(self, name):
        self.do_lookup(name)

    def pop(self):
        stack, dictionary = self.world.getCurrentState()
        if not stack:
            return
        self.world.step(['drop'])

    def push(self, it):
        it = '"%s"' % it.encode('utf8')
        self.world.step([it])

    def peek(self):
        stack, dictionary = self.world.getCurrentState()
        if not stack:
            raise IndexError
        return stack[0]

    def interpret(self, command):
        self.world.step(command.split())

    def has(self, name):
        stack, dictionary = self.world.getCurrentState()
        try:

# Path: pigeon/xerblin/btree.py
# def get(node, key):
#     '''
#     Return the value stored under key or raise KeyError if not found.
#     '''
#     if not node:
#         raise KeyError, key
# 
#     node_key, value, lower, higher = node
# 
#     if key == node_key:
#         return value
# 
#     return get(lower if key < node_key else higher, key)


# Path: pigeon/xerblin/TextViewer.py
from Tkinter import (
    Text,
    Toplevel,
    TclError,
    END,
    INSERT,
    SEL,
    DISABLED,
    NORMAL,
    )
from time import time
from traceback import format_exc
from pigeon.xerblin.btree import get
    from pigeon.xerblin.btree import items
    from pigeon.xerblin.world import HistoryListWorld, view0
import re, os

        self.world = world

    def do_lookup(self, name):
        self.world.step(['"%s"' % (name,), 'lookup'])

    def do_opendoc(self, name):
        self.do_lookup(name)

    def pop(self):
        stack, dictionary = self.world.getCurrentState()
        if not stack:
            return
        self.world.step(['drop'])

    def push(self, it):
        it = '"%s"' % it.encode('utf8')
        self.world.step([it])

    def peek(self):
        stack, dictionary = self.world.getCurrentState()
        if not stack:
            raise IndexError
        return stack[0]

    def interpret(self, command):
        self.world.step(command.split())

    def has(self, name):
        stack, dictionary = self.world.getCurrentState()
        try:

            get(dictionary, name)