From 2f03dfa43b45c29919c37008b24b2f28067f3d20 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Fri, 18 Jul 2014 11:59:12 +0200 Subject: [PATCH] CalamaresPrivate ==> CalamaresPython --- src/libcalamares/JobQueue.cpp | 2 +- src/libcalamares/PythonJob.cpp | 12 ++++++------ src/libcalamares/PythonJob.h | 10 +++++----- src/libcalamares/PythonJobApi.cpp | 2 +- src/libcalamares/PythonJobApi.h | 2 +- src/libcalamares/PythonJobHelper.cpp | 12 ++++++------ src/libcalamares/PythonJobHelper.h | 12 ++++++------ src/libcalamaresui/modulesystem/Module.cpp | 6 ++---- 8 files changed, 28 insertions(+), 30 deletions(-) diff --git a/src/libcalamares/JobQueue.cpp b/src/libcalamares/JobQueue.cpp index bfe2fe952..13162a603 100644 --- a/src/libcalamares/JobQueue.cpp +++ b/src/libcalamares/JobQueue.cpp @@ -38,7 +38,7 @@ public: , m_queue( queue ) { #ifdef WITH_PYTHON - new CalamaresPrivate::PythonJobHelper( this ); + new CalamaresPython::Helper( this ); #endif } diff --git a/src/libcalamares/PythonJob.cpp b/src/libcalamares/PythonJob.cpp index 852923b4a..d38bf1d5f 100644 --- a/src/libcalamares/PythonJob.cpp +++ b/src/libcalamares/PythonJob.cpp @@ -40,9 +40,9 @@ BOOST_PYTHON_MODULE( libcalamares ) bp::scope().attr( "VERSION" ) = CALAMARES_VERSION; bp::scope().attr( "VERSION_SHORT" ) = CALAMARES_VERSION_SHORT; - bp::class_< CalamaresPrivate::PythonJobInterface >( "job", bp::init< const Calamares::PythonJob* >() ) - .def( "prettyName", &CalamaresPrivate::PythonJobInterface::prettyName ) - .def( "workingPath", &CalamaresPrivate::PythonJobInterface::workingPath ); + bp::class_< CalamaresPython::PythonJobInterface >( "job", bp::init< const Calamares::PythonJob* >() ) + .def( "prettyName", &CalamaresPython::PythonJobInterface::prettyName ) + .def( "workingPath", &CalamaresPython::PythonJobInterface::workingPath ); } @@ -105,7 +105,7 @@ PythonJob::exec() bp::object calamaresModule = bp::import( "libcalamares" ); bp::dict calamaresNamespace = bp::extract< bp::dict >( calamaresModule.attr( "__dict__" ) ); - calamaresNamespace[ "job" ] = CalamaresPrivate::PythonJobInterface( this ); + calamaresNamespace[ "job" ] = CalamaresPython::PythonJobInterface( this ); bp::object result = bp::exec_file( scriptFI.absoluteFilePath().toLocal8Bit().data(), scriptNamespace, @@ -134,10 +134,10 @@ PythonJob::exec() } -CalamaresPrivate::PythonJobHelper* +CalamaresPython::Helper* PythonJob::helper() { - return CalamaresPrivate::PythonJobHelper::s_instance; + return CalamaresPython::Helper::s_instance; } diff --git a/src/libcalamares/PythonJob.h b/src/libcalamares/PythonJob.h index 63312eee4..38500bc0e 100644 --- a/src/libcalamares/PythonJob.h +++ b/src/libcalamares/PythonJob.h @@ -21,10 +21,10 @@ #include "Job.h" -namespace CalamaresPrivate +namespace CalamaresPython { class PythonJobInterface; -class PythonJobHelper; +class Helper; } namespace Calamares { @@ -42,9 +42,9 @@ public: JobResult exec() override; private: - friend class CalamaresPrivate::PythonJobHelper; - friend class CalamaresPrivate::PythonJobInterface; - CalamaresPrivate::PythonJobHelper* helper(); + friend class CalamaresPython::Helper; + friend class CalamaresPython::PythonJobInterface; + CalamaresPython::Helper* helper(); QString m_scriptFile; QString m_workingPath; }; diff --git a/src/libcalamares/PythonJobApi.cpp b/src/libcalamares/PythonJobApi.cpp index 31230c626..f3e09cae7 100644 --- a/src/libcalamares/PythonJobApi.cpp +++ b/src/libcalamares/PythonJobApi.cpp @@ -19,7 +19,7 @@ #include "PythonJobApi.h" -namespace CalamaresPrivate +namespace CalamaresPython { PythonJobInterface::PythonJobInterface( const Calamares::PythonJob* parent ) diff --git a/src/libcalamares/PythonJobApi.h b/src/libcalamares/PythonJobApi.h index 1da7ecd9e..fd3bf7b72 100644 --- a/src/libcalamares/PythonJobApi.h +++ b/src/libcalamares/PythonJobApi.h @@ -23,7 +23,7 @@ #include "PythonJob.h" -namespace CalamaresPrivate +namespace CalamaresPython { class PythonJobInterface diff --git a/src/libcalamares/PythonJobHelper.cpp b/src/libcalamares/PythonJobHelper.cpp index 9a2938918..5edc9a5a9 100644 --- a/src/libcalamares/PythonJobHelper.cpp +++ b/src/libcalamares/PythonJobHelper.cpp @@ -29,11 +29,11 @@ namespace bp = boost::python; -namespace CalamaresPrivate { +namespace CalamaresPython { -PythonJobHelper* PythonJobHelper::s_instance = nullptr; +Helper* Helper::s_instance = nullptr; -PythonJobHelper::PythonJobHelper( QObject* parent ) +Helper::Helper( QObject* parent ) : QObject( parent ) { // Let's make extra sure we only call Py_Initialize once @@ -81,12 +81,12 @@ PythonJobHelper::PythonJobHelper( QObject* parent ) s_instance = this; } -PythonJobHelper::~PythonJobHelper() +Helper::~Helper() {} boost::python::object -PythonJobHelper::createCleanNamespace() +Helper::createCleanNamespace() { // To make sure we run each script with a clean namespace, we only fetch the // builtin namespace from the interpreter as it was when freshly initialized. @@ -98,7 +98,7 @@ PythonJobHelper::createCleanNamespace() QString -PythonJobHelper::handleLastError() +Helper::handleLastError() { using namespace boost::python; using namespace boost; diff --git a/src/libcalamares/PythonJobHelper.h b/src/libcalamares/PythonJobHelper.h index e5c17856b..75752301b 100644 --- a/src/libcalamares/PythonJobHelper.h +++ b/src/libcalamares/PythonJobHelper.h @@ -26,22 +26,22 @@ #undef slots #include -namespace CalamaresPrivate { +namespace CalamaresPython { -class PythonJobHelper : public QObject +class Helper : public QObject { Q_OBJECT public: - explicit PythonJobHelper( QObject* parent = nullptr ); - virtual ~PythonJobHelper(); + explicit Helper( QObject* parent = nullptr ); + virtual ~Helper(); boost::python::object createCleanNamespace(); QString handleLastError(); private: - friend PythonJobHelper* Calamares::PythonJob::helper(); - static PythonJobHelper* s_instance; + friend Helper* Calamares::PythonJob::helper(); + static Helper* s_instance; boost::python::object m_mainModule; boost::python::object m_mainNamespace; diff --git a/src/libcalamaresui/modulesystem/Module.cpp b/src/libcalamaresui/modulesystem/Module.cpp index f564b45f1..b2d86b253 100644 --- a/src/libcalamaresui/modulesystem/Module.cpp +++ b/src/libcalamaresui/modulesystem/Module.cpp @@ -39,12 +39,10 @@ // Example module.conf /* --- -type: "core" #core or view +type: "view" #job or view name: "foo" #the module name. must be unique and same as the parent directory interface: "qtplugin" #can be: qtplugin, python, process, ... -requires: [] #list of module names that must also be loaded. only applies to - #binary plugins! these are actual link-time dependencies, not - #conceptual dependencies for the setup procedure +requires: [] #list of module names that must also be loaded before this one */ void