2017-12-20 14:39:09 +01:00
|
|
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
2014-07-16 16:09:53 +02:00
|
|
|
*
|
2020-08-20 22:42:19 +02:00
|
|
|
* SPDX-FileCopyrightText: 2014 Teo Mrnjavac <teo@kde.org>
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2014-07-16 16:09:53 +02:00
|
|
|
*
|
|
|
|
* 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 "PythonJobModule.h"
|
|
|
|
|
|
|
|
#include "PythonJob.h"
|
|
|
|
|
|
|
|
#include <QDir>
|
|
|
|
|
|
|
|
|
2018-06-18 16:56:10 +02:00
|
|
|
namespace Calamares
|
|
|
|
{
|
2014-07-16 16:09:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
Module::Type
|
|
|
|
PythonJobModule::type() const
|
|
|
|
{
|
2019-05-07 12:33:31 +02:00
|
|
|
return Module::Type::Job;
|
2014-07-16 16:09:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Module::Interface
|
|
|
|
PythonJobModule::interface() const
|
|
|
|
{
|
2019-05-07 12:33:31 +02:00
|
|
|
return Module::Interface::Python;
|
2014-07-16 16:09:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
PythonJobModule::loadSelf()
|
|
|
|
{
|
|
|
|
if ( m_loaded )
|
2019-06-27 15:15:47 +02:00
|
|
|
{
|
2014-07-16 16:09:53 +02:00
|
|
|
return;
|
2019-06-27 15:15:47 +02:00
|
|
|
}
|
2014-07-16 16:09:53 +02:00
|
|
|
|
2020-01-25 15:15:32 +01:00
|
|
|
m_job = Calamares::job_ptr( new PythonJob( instanceKey(), m_scriptFileName, m_workingPath, m_configurationMap ) );
|
2014-07-16 16:09:53 +02:00
|
|
|
m_loaded = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-11-03 15:10:37 +01:00
|
|
|
JobList
|
2014-07-22 16:54:34 +02:00
|
|
|
PythonJobModule::jobs() const
|
|
|
|
{
|
2017-11-03 15:10:37 +01:00
|
|
|
return JobList() << m_job;
|
2014-07-22 16:54:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-16 16:09:53 +02:00
|
|
|
void
|
2020-08-11 22:12:16 +02:00
|
|
|
PythonJobModule::initFrom( const ModuleSystem::Descriptor& moduleDescriptor )
|
2014-07-16 16:09:53 +02:00
|
|
|
{
|
|
|
|
QDir directory( location() );
|
|
|
|
m_workingPath = directory.absolutePath();
|
2020-08-11 22:12:16 +02:00
|
|
|
m_scriptFileName = moduleDescriptor.script();
|
2014-07-16 16:09:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
PythonJobModule::PythonJobModule()
|
|
|
|
: Module()
|
2019-06-27 15:15:47 +02:00
|
|
|
{
|
|
|
|
}
|
2014-07-16 16:09:53 +02:00
|
|
|
|
|
|
|
|
2020-05-01 10:01:24 +02:00
|
|
|
PythonJobModule::~PythonJobModule() { }
|
2014-07-16 16:09:53 +02:00
|
|
|
|
|
|
|
|
2019-06-27 15:15:47 +02:00
|
|
|
} // namespace Calamares
|