Select Git revision
PythonJob.cpp
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
PythonJob.cpp 13.05 KiB
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>
*
* Calamares 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.
*
* Calamares 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 Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#include "PythonJob.h"
#include "PythonHelper.h"
#include "utils/Logger.h"
#include "GlobalStorage.h"
#include "JobQueue.h"
#include <QDir>
#undef slots
#include <boost/python.hpp>
#include <boost/python/args.hpp>
#include "PythonJobApi.h"
namespace bp = boost::python;
BOOST_PYTHON_FUNCTION_OVERLOADS( mount_overloads,
CalamaresPython::mount,
2, 4 );
BOOST_PYTHON_FUNCTION_OVERLOADS( target_env_call_str_overloads,
CalamaresPython::target_env_call,
1, 3 );
BOOST_PYTHON_FUNCTION_OVERLOADS( target_env_call_list_overloads,
CalamaresPython::target_env_call,
1, 3 );
BOOST_PYTHON_FUNCTION_OVERLOADS( check_target_env_call_str_overloads,
CalamaresPython::check_target_env_call,
1, 3 );
BOOST_PYTHON_FUNCTION_OVERLOADS( check_target_env_call_list_overloads,
CalamaresPython::check_target_env_call,
1, 3 );
BOOST_PYTHON_FUNCTION_OVERLOADS( check_target_env_output_str_overloads,
CalamaresPython::check_target_env_output,
1, 3 );
BOOST_PYTHON_FUNCTION_OVERLOADS( check_target_env_output_list_overloads,
CalamaresPython::check_target_env_output,
1, 3 );
BOOST_PYTHON_MODULE( libcalamares )
{
bp::object package = bp::scope();
package.attr( "__path__" ) = "libcalamares";
bp::scope().attr( "ORGANIZATION_NAME" ) = CALAMARES_ORGANIZATION_NAME;
bp::scope().attr( "ORGANIZATION_DOMAIN" ) = CALAMARES_ORGANIZATION_DOMAIN;
bp::scope().attr( "APPLICATION_NAME" ) = CALAMARES_APPLICATION_NAME;
bp::scope().attr( "VERSION" ) = CALAMARES_VERSION;
bp::scope().attr( "VERSION_SHORT" ) = CALAMARES_VERSION_SHORT;
bp::class_< CalamaresPython::PythonJobInterface >( "Job", bp::init< Calamares::PythonJob* >() )
.def_readonly( "module_name", &CalamaresPython::PythonJobInterface::moduleName )