# Path: revolver/core.py
# def run(*args, **kwargs):
#     if not env.sudo_forced:
#         return _run(*args, **kwargs)
# 
#     return sudo(*args, **kwargs)
# 
# Path: revolver/package.py
# def is_installed(name):
# def install_ppa(name):
# 
# Path: revolver/tool/pythonbrew.py
# def install():
# def ensure():


from revolver.core import run
from revolver import package
from revolver.tool import pythonbrew
# -*- coding: utf-8 -*-

from __future__ import absolute_import, division, with_statement



def install(version, _update=True):
    # Without this we would build python without the bz2 package
    package.ensure("libbz2-dev")

    pythonbrew.ensure()


# Path: revolver/core.py
# def run(*args, **kwargs):
#     if not env.sudo_forced:
#         return _run(*args, **kwargs)
# 
#     return sudo(*args, **kwargs)
# 
# Path: revolver/package.py
# def is_installed(name):
# def install_ppa(name):
# 
# Path: revolver/tool/pythonbrew.py
# def install():
# def ensure():


# Path: revolver/tool/python.py
from revolver.core import run
from revolver import package
from revolver.tool import pythonbrew

# -*- coding: utf-8 -*-

from __future__ import absolute_import, division, with_statement



def install(version, _update=True):
    # Without this we would build python without the bz2 package
    package.ensure("libbz2-dev")

    pythonbrew.ensure()


    status = run("pythonbrew switch %s; true" % version)