# Path: bts_tools/core.py
# def run(cmd, capture_io=False, verbose=True, log_on_fail=True,
#         run_dir=None, forward_signals=False, pidfile=None, shell=False):
#     r = _run(cmd, capture_io=capture_io, verbose=verbose,
#              run_dir=run_dir, forward_signals=forward_signals, pidfile=pidfile, shell=shell)
#     if r.status != 0:
#         if log_on_fail:
#             log.warning('Failed running: %s' % cmd)
#             if capture_io:
#                 log.warning('\nSTDOUT:\n{}\nSTDERR:\n:{}'.format(r.stdout, r.stderr))
#         raise RuntimeError('Failed running: %s' % cmd)
#     return r
# 
# def replace_in_file(filename, old, new, **kwargs):
#     contents = open(filename).read()
#     contents = re.sub(old, new, contents, **kwargs)
#     open(filename, 'w').write(contents)


from ..core import run, replace_in_file
from pathlib import Path
import os
import sys
import os.path
import psutil
import logging
#
# bts_tools - Tools to easily manage the bitshares client
# Copyright (c) 2017 Nicolas Wack <wackou@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#


log = logging.getLogger(__name__)


def short_description():
    return 'download, compile and install the specified boost version'


def help():
    return """install_boost <boost_ver> [<base_build_dir>] [<prefix>]'
    
boost_ver: minor version of boost which you want to install, e.g.: 58 will install boost1.58, etc.

# Path: bts_tools/core.py
# def run(cmd, capture_io=False, verbose=True, log_on_fail=True,
#         run_dir=None, forward_signals=False, pidfile=None, shell=False):
#     r = _run(cmd, capture_io=capture_io, verbose=verbose,
#              run_dir=run_dir, forward_signals=forward_signals, pidfile=pidfile, shell=shell)
#     if r.status != 0:
#         if log_on_fail:
#             log.warning('Failed running: %s' % cmd)
#             if capture_io:
#                 log.warning('\nSTDOUT:\n{}\nSTDERR:\n:{}'.format(r.stdout, r.stderr))
#         raise RuntimeError('Failed running: %s' % cmd)
#     return r
# 
# def replace_in_file(filename, old, new, **kwargs):
#     contents = open(filename).read()
#     contents = re.sub(old, new, contents, **kwargs)
#     open(filename, 'w').write(contents)


# Path: bts_tools/commands/install_boost.py
from ..core import run, replace_in_file
from pathlib import Path
import os
import sys
import os.path
import psutil
import logging

#
# bts_tools - Tools to easily manage the bitshares client
# Copyright (c) 2017 Nicolas Wack <wackou@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#


log = logging.getLogger(__name__)


def short_description():
    return 'download, compile and install the specified boost version'


def help():
    return """install_boost <boost_ver> [<base_build_dir>] [<prefix>]'
    
boost_ver: minor version of boost which you want to install, e.g.: 58 will install boost1.58, etc.

base_build_dir: directory in which the source tarball will be downloaded and extracted [default: $HOME]