

def _install(path, remove=False, prefix=sys.prefix):
    if (abspath(prefix) == abspath(sys.prefix)):
        env_name = None
    else:
        env_name = basename(prefix)
    data = json.load(open(path))
    try:
        menu_name = data['menu_name']
    except KeyError:
        menu_name = ('Python-%d.%d' % sys.version_info[:2])
    shortcuts = data['menu_items']
    m = Menu(menu_name)
    if remove:
        for sc in shortcuts:
            ShortCut(m, sc, target_prefix=prefix, env_name=env_name).remove()
        m.remove()
    else:
        m.create()
        for sc in shortcuts:
            ShortCut(m, sc, target_prefix=prefix, env_name=env_name).create()

dataset/ETHPy150Open ContinuumIO/menuinst/menuinst/__init__.py _install/original