\brief Execute python command in the interpreter.
\param command string with command and arguments
*/
-void PyConsole_Console::exec( const QString& command )
+void PyConsole_Console::exec (const QString& command,
+ const bool shouldPrint)
{
if ( myEditor )
- myEditor->exec( command );
+ myEditor->exec (command, shouldPrint);
}
/*!
bool isShowBanner() const;
void setIsShowBanner( const bool );
- void exec( const QString& );
+ void exec (const QString&, const bool shouldPrint = true);
void execAndWait( const QString& );
virtual bool eventFilter( QObject*, QEvent* );
as if the user typed it manually.
\param command python command to be executed
*/
-void PyConsole_Editor::exec( const QString& command )
+void PyConsole_Editor::exec( const QString& command, const bool shouldPrint )
{
if ( isReadOnly() ) {
// some interactive command is being executed in this editor...
for ( int i = 0; i < lines.size(); i++ ) {
if ( !lines[i].trimmed().isEmpty() )
myHistory.push_back( lines[i] );
- addText( ( i == 0 ? READY_PROMPT : DOTS_PROMPT ) + lines[i], i != 0 );
+ if (shouldPrint)
+ addText( ( i == 0 ? READY_PROMPT : DOTS_PROMPT ) + lines[i], i != 0 );
}
// IPAL20182
addText( "", true );
virtual void addText( const QString& str, const bool newBlock = false );
bool isCommand( const QString& str ) const;
- virtual void exec( const QString& command );
+ virtual void exec( const QString& command, const bool shouldPrint = true );
void execAndWait( const QString& command );
bool isSync() const;