mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-02 03:45:38 -04:00
We have a Python API for jobmodules!
Created a Boost.Python module interface in libcalamares. Added a PythonJob wrapper and exposed it in the Python module. Rename target calamareslib ==> calamares so in Python it's libcalamares. Python-related classes in libcalamares that aren't exported as C++ symbols are now in a CalamaresPrivate namespace. Import the libcalamares python module into every Python script before running it. Added Python error handling to PythonJobHelper. Added some more testing code to dummypython module.
This commit is contained in:
parent
c13179fdf0
commit
a61a36d99d
11 changed files with 217 additions and 25 deletions
42
src/libcalamares/PythonJobApi.cpp
Normal file
42
src/libcalamares/PythonJobApi.cpp
Normal file
|
@ -0,0 +1,42 @@
|
|||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, 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 "PythonJobApi.h"
|
||||
|
||||
|
||||
namespace CalamaresPrivate
|
||||
{
|
||||
|
||||
PythonJobInterface::PythonJobInterface( const Calamares::PythonJob* parent )
|
||||
: m_parent( parent )
|
||||
{}
|
||||
|
||||
|
||||
std::string
|
||||
PythonJobInterface::prettyName() const
|
||||
{
|
||||
return m_parent->prettyName().toStdString();
|
||||
}
|
||||
|
||||
std::string
|
||||
PythonJobInterface::workingPath() const
|
||||
{
|
||||
return m_parent->m_workingPath.toStdString();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue