[libcalamares] Avoid parameter name 'stdin'
This commit is contained in:
parent
ebdcb15703
commit
932ab17c9a
@ -61,12 +61,12 @@ bp_list_to_qstringlist( const bp::list& args )
|
||||
}
|
||||
|
||||
static inline CalamaresUtils::ProcessResult
|
||||
target_env_command( const QStringList& args, const std::string& stdin, int timeout )
|
||||
target_env_command( const QStringList& args, const std::string& input, int timeout )
|
||||
{
|
||||
// Since Python doesn't give us the type system for distinguishing
|
||||
// seconds from other integral types, massage to seconds here.
|
||||
return CalamaresUtils::System::instance()->targetEnvCommand(
|
||||
args, QString(), QString::fromStdString( stdin ), std::chrono::seconds( timeout ) );
|
||||
args, QString(), QString::fromStdString( input ), std::chrono::seconds( timeout ) );
|
||||
}
|
||||
|
||||
namespace CalamaresPython
|
||||
@ -85,31 +85,31 @@ mount( const std::string& device_path,
|
||||
}
|
||||
|
||||
int
|
||||
target_env_call( const std::string& command, const std::string& stdin, int timeout )
|
||||
target_env_call( const std::string& command, const std::string& input, int timeout )
|
||||
{
|
||||
return target_env_command( QStringList { QString::fromStdString( command ) }, stdin, timeout ).first;
|
||||
return target_env_command( QStringList { QString::fromStdString( command ) }, input, timeout ).first;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
target_env_call( const bp::list& args, const std::string& stdin, int timeout )
|
||||
target_env_call( const bp::list& args, const std::string& input, int timeout )
|
||||
{
|
||||
return target_env_command( bp_list_to_qstringlist( args ), stdin, timeout ).first;
|
||||
return target_env_command( bp_list_to_qstringlist( args ), input, timeout ).first;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
check_target_env_call( const std::string& command, const std::string& stdin, int timeout )
|
||||
check_target_env_call( const std::string& command, const std::string& input, int timeout )
|
||||
{
|
||||
auto ec = target_env_command( QStringList { QString::fromStdString( command ) }, stdin, timeout );
|
||||
auto ec = target_env_command( QStringList { QString::fromStdString( command ) }, input, timeout );
|
||||
return handle_check_target_env_call_error( ec, QString::fromStdString( command ) );
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
check_target_env_call( const bp::list& args, const std::string& stdin, int timeout )
|
||||
check_target_env_call( const bp::list& args, const std::string& input, int timeout )
|
||||
{
|
||||
auto ec = target_env_command( bp_list_to_qstringlist( args ), stdin, timeout );
|
||||
auto ec = target_env_command( bp_list_to_qstringlist( args ), input, timeout );
|
||||
if ( !ec.first )
|
||||
{
|
||||
return ec.first;
|
||||
@ -121,19 +121,19 @@ check_target_env_call( const bp::list& args, const std::string& stdin, int timeo
|
||||
|
||||
|
||||
std::string
|
||||
check_target_env_output( const std::string& command, const std::string& stdin, int timeout )
|
||||
check_target_env_output( const std::string& command, const std::string& input, int timeout )
|
||||
{
|
||||
auto ec = target_env_command( QStringList { QString::fromStdString( command ) }, stdin, timeout );
|
||||
auto ec = target_env_command( QStringList { QString::fromStdString( command ) }, input, timeout );
|
||||
handle_check_target_env_call_error( ec, QString::fromStdString( command ) );
|
||||
return ec.second.toStdString();
|
||||
}
|
||||
|
||||
|
||||
std::string
|
||||
check_target_env_output( const bp::list& args, const std::string& stdin, int timeout )
|
||||
check_target_env_output( const bp::list& args, const std::string& input, int timeout )
|
||||
{
|
||||
QStringList list = bp_list_to_qstringlist( args );
|
||||
auto ec = target_env_command( list, stdin, timeout );
|
||||
auto ec = target_env_command( list, input, timeout );
|
||||
handle_check_target_env_call_error( ec, list.join( ' ' ) );
|
||||
return ec.second.toStdString();
|
||||
}
|
||||
@ -201,7 +201,7 @@ static inline int
|
||||
_process_output( Calamares::Utils::RunLocation location,
|
||||
const boost::python::list& args,
|
||||
const boost::python::object& callback,
|
||||
const std::string& stdin,
|
||||
const std::string& input,
|
||||
int timeout )
|
||||
{
|
||||
Calamares::Utils::Runner r( bp_list_to_qstringlist( args ) );
|
||||
@ -222,9 +222,9 @@ _process_output( Calamares::Utils::RunLocation location,
|
||||
}
|
||||
r.enableOutputProcessing();
|
||||
}
|
||||
if ( !stdin.empty() )
|
||||
if ( !input.empty() )
|
||||
{
|
||||
r.setInput( QString::fromStdString( stdin ) );
|
||||
r.setInput( QString::fromStdString( input ) );
|
||||
}
|
||||
if ( timeout > 0 )
|
||||
{
|
||||
@ -243,19 +243,19 @@ _process_output( Calamares::Utils::RunLocation location,
|
||||
int
|
||||
target_env_process_output( const boost::python::list& args,
|
||||
const boost::python::object& callback,
|
||||
const std::string& stdin,
|
||||
const std::string& input,
|
||||
int timeout )
|
||||
{
|
||||
return _process_output( Calamares::Utils::RunLocation::RunInTarget, args, callback, stdin, timeout );
|
||||
return _process_output( Calamares::Utils::RunLocation::RunInTarget, args, callback, input, timeout );
|
||||
}
|
||||
|
||||
int
|
||||
host_env_process_output( const boost::python::list& args,
|
||||
const boost::python::object& callback,
|
||||
const std::string& stdin,
|
||||
const std::string& input,
|
||||
int timeout )
|
||||
{
|
||||
return _process_output( Calamares::Utils::RunLocation::RunInHost, args, callback, stdin, timeout );
|
||||
return _process_output( Calamares::Utils::RunLocation::RunInHost, args, callback, input, timeout );
|
||||
}
|
||||
|
||||
|
||||
|
@ -28,28 +28,28 @@ int mount( const std::string& device_path,
|
||||
const std::string& filesystem_name = std::string(),
|
||||
const std::string& options = std::string() );
|
||||
|
||||
int target_env_call( const std::string& command, const std::string& stdin = std::string(), int timeout = 0 );
|
||||
int target_env_call( const std::string& command, const std::string& input = std::string(), int timeout = 0 );
|
||||
|
||||
int target_env_call( const boost::python::list& args, const std::string& stdin = std::string(), int timeout = 0 );
|
||||
int target_env_call( const boost::python::list& args, const std::string& input = std::string(), int timeout = 0 );
|
||||
|
||||
int check_target_env_call( const std::string& command, const std::string& stdin = std::string(), int timeout = 0 );
|
||||
int check_target_env_call( const std::string& command, const std::string& input = std::string(), int timeout = 0 );
|
||||
|
||||
int check_target_env_call( const boost::python::list& args, const std::string& stdin = std::string(), int timeout = 0 );
|
||||
int check_target_env_call( const boost::python::list& args, const std::string& input = std::string(), int timeout = 0 );
|
||||
|
||||
std::string
|
||||
check_target_env_output( const std::string& command, const std::string& stdin = std::string(), int timeout = 0 );
|
||||
check_target_env_output( const std::string& command, const std::string& input = std::string(), int timeout = 0 );
|
||||
|
||||
std::string
|
||||
check_target_env_output( const boost::python::list& args, const std::string& stdin = std::string(), int timeout = 0 );
|
||||
check_target_env_output( const boost::python::list& args, const std::string& input = std::string(), int timeout = 0 );
|
||||
|
||||
int target_env_process_output( const boost::python::list& args,
|
||||
const boost::python::object& callback = boost::python::object(),
|
||||
const std::string& stdin = std::string(),
|
||||
const std::string& input = std::string(),
|
||||
int timeout = 0 );
|
||||
|
||||
int host_env_process_output( const boost::python::list& args,
|
||||
const boost::python::object& callback = boost::python::object(),
|
||||
const std::string& stdin = std::string(),
|
||||
const std::string& input = std::string(),
|
||||
int timeout = 0 );
|
||||
|
||||
std::string obscure( const std::string& string );
|
||||
|
Loading…
Reference in New Issue
Block a user