source: calamares/trunk/fuentes/src/libcalamares/PythonJobApi.h @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 13 months ago

sync with github

File size: 2.7 KB
Line 
1/* === This file is part of Calamares - <https://github.com/calamares> ===
2 *
3 *   Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>
4 *   Copyright 2017, Adriaan de Groot <groot@kde.org>
5 *
6 *   Calamares is free software: you can redistribute it and/or modify
7 *   it under the terms of the GNU General Public License as published by
8 *   the Free Software Foundation, either version 3 of the License, or
9 *   (at your option) any later version.
10 *
11 *   Calamares is distributed in the hope that it will be useful,
12 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 *   GNU General Public License for more details.
15 *
16 *   You should have received a copy of the GNU General Public License
17 *   along with Calamares. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef PYTHONJOBAPI_H
21#define PYTHONJOBAPI_H
22
23#include "CalamaresVersion.h"
24
25#include "PythonJob.h"
26
27#undef slots
28#include <boost/python/dict.hpp>
29
30namespace CalamaresPython
31{
32
33int mount( const std::string& device_path,
34           const std::string& mount_point,
35           const std::string& filesystem_name = std::string(),
36           const std::string& options = std::string() );
37
38int target_env_call( const std::string& command,
39                 const std::string& stdin = std::string(),
40                 int timeout = 0 );
41
42int target_env_call( const boost::python::list& args,
43                 const std::string& stdin = std::string(),
44                 int timeout = 0 );
45
46int check_target_env_call( const std::string& command,
47                       const std::string& stdin = std::string(),
48                       int timeout = 0 );
49
50int check_target_env_call( const boost::python::list& args,
51                       const std::string& stdin = std::string(),
52                       int timeout = 0 );
53
54std::string check_target_env_output( const std::string& command,
55                                 const std::string& stdin = std::string(),
56                                 int timeout = 0 );
57
58std::string check_target_env_output( const boost::python::list& args,
59                                 const std::string& stdin = std::string(),
60                                 int timeout = 0 );
61
62std::string obscure( const std::string& string );
63
64boost::python::object gettext_path();
65
66boost::python::list gettext_languages();
67
68void debug( const std::string& s );
69void warning( const std::string& s );
70
71class PythonJobInterface
72{
73public:
74    explicit PythonJobInterface( Calamares::PythonJob* parent );
75
76    std::string moduleName;
77    std::string prettyName;
78    std::string workingPath;
79
80    boost::python::dict configuration;
81
82    void setprogress( qreal progress );
83
84private:
85    Calamares::PythonJob* m_parent;
86};
87
88}
89
90#endif // PYTHONJOBAPI_H
Note: See TracBrowser for help on using the repository browser.