Skip to content
Snippets Groups Projects
Select Git revision
  • d6d8e7353203f18a673e19e2a4a2826e09399263
  • development default protected
  • 3.2.x-stable
  • prepare
  • 6b369dc5
  • 3.1.x-stable
  • 3.0.x-stable
  • 2.4.x-stable
  • v3.2.61
  • v3.2.60
  • v3.2.59
  • v3.2.54
  • v3.2.53
  • v3.2.52
  • v3.2.51
  • v3.2.48
  • v3.2.45
  • v3.2.44.3
  • v3.2.44
  • v3.2.40
  • v3.2.13
  • v3.2.9
  • v3.2.8
  • v3.2.7
  • v3.2.6
  • v3.2.5
  • v3.2.4
  • v3.2.3
28 results

PythonJob.cpp

Blame
  • 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 )