From eb6b8ac61323d9c6463e251427753310347e878e Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Fri, 8 Aug 2014 14:20:09 +0200 Subject: [PATCH] Add check_chroot_output to Python interface. --- src/libcalamares/PythonJob.cpp | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/libcalamares/PythonJob.cpp b/src/libcalamares/PythonJob.cpp index 4c79a31f8..07283a469 100644 --- a/src/libcalamares/PythonJob.cpp +++ b/src/libcalamares/PythonJob.cpp @@ -49,6 +49,12 @@ BOOST_PYTHON_FUNCTION_OVERLOADS( check_chroot_call_str_overloads, BOOST_PYTHON_FUNCTION_OVERLOADS( check_chroot_call_list_overloads, CalamaresPython::check_chroot_call, 1, 3 ); +BOOST_PYTHON_FUNCTION_OVERLOADS( check_chroot_output_str_overloads, + CalamaresPython::check_chroot_output, + 1, 3 ); +BOOST_PYTHON_FUNCTION_OVERLOADS( check_chroot_output_list_overloads, + CalamaresPython::check_chroot_output, + 1, 3 ); BOOST_PYTHON_MODULE( libcalamares ) { bp::object package = bp::scope(); @@ -171,6 +177,35 @@ BOOST_PYTHON_MODULE( libcalamares ) "successfully, or raises a subprocess.CalledProcessError." ) ); + + bp::def( + "check_chroot_output", + static_cast< std::string (*)( const std::string&, + const std::string&, + int ) >( &CalamaresPython::check_chroot_output ), + check_chroot_output_str_overloads( + bp::args( "command", + "stdin", + "timeout" ), + "Runs the specified command in the chroot of the target system.\n" + "Returns the program's standard output, and raises a " + "subprocess.CalledProcessError if something went wrong." + ) + ); + bp::def( + "check_chroot_output", + static_cast< std::string (*)( const bp::list&, + const std::string&, + int ) >( &CalamaresPython::check_chroot_output ), + check_chroot_output_list_overloads( + bp::args( "args", + "stdin", + "timeout" ), + "Runs the specified command in the chroot of the target system.\n" + "Returns the program's standard output, and raises a " + "subprocess.CalledProcessError if something went wrong." + ) + ); }