mirror of https://github.com/cutefishos/calamares
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.main
parent
c13179fdf0
commit
a61a36d99d
@ -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();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
/* === 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/>.
|
||||
*/
|
||||
|
||||
#ifndef PYTHONJOBAPI_H
|
||||
#define PYTHONJOBAPI_H
|
||||
|
||||
#include "CalamaresVersion.h"
|
||||
|
||||
#include "PythonJob.h"
|
||||
|
||||
namespace CalamaresPrivate
|
||||
{
|
||||
|
||||
class PythonJobInterface
|
||||
{
|
||||
public:
|
||||
explicit PythonJobInterface( const Calamares::PythonJob* parent );
|
||||
|
||||
std::string prettyName() const;
|
||||
|
||||
std::string workingPath() const;
|
||||
|
||||
private:
|
||||
const Calamares::PythonJob* m_parent;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // PYTHONJOBAPI_H
|
Loading…
Reference in New Issue