script.remove( QRegExp("^python.*[\\s]+") );
QString cmd = script+" "+args;
- QString command = QString( "exec(open(\"%1\",encoding='utf-8').read())" ).arg(cmd.trimmed());
+
+ QString command = QString( "exec(open(\"%1\", \"rb\").read())" ).arg(cmd.trimmed());
pyConsole->exec(command);
}
} // end for loop on pyfiles QStringList
{
onNewDoc();
- QString command = QString("exec(open(\"%1\",encoding='utf-8').read())").arg(aFile);
+ QString command = QString("exec(open(\"%1\", \"rb\").read())").arg(aFile);
#ifndef DISABLE_PYCONSOLE
PyConsole_Console* pyConsole = pythonConsole();
/*!SLOT. Copy objects to study maneger from selection maneger..*/
void SalomeApp_Application::onCopy()
{
+ LightApp_Application::onCopy();
+
SALOME_ListIO list;
LightApp_SelectionMgr* mgr = selectionMgr();
mgr->selectedObjects(list);
if(it.More())
{
_PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry());
- try {
- stdDS->Copy(so);
- onSelectionChanged();
- }
- catch(...) {
+ if( so )
+ {
+ try {
+ stdDS->Copy(so);
+ onSelectionChanged();
+ }
+ catch(...) {
+ }
}
}
}
/*!SLOT. Paste objects to study maneger from selection manager.*/
void SalomeApp_Application::onPaste()
{
+ LightApp_Application::onPaste();
+
SALOME_ListIO list;
LightApp_SelectionMgr* mgr = selectionMgr();
mgr->selectedObjects(list);
if(it.More())
{
_PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry());
- try {
- stdDS->Paste(so);
- updateObjectBrowser( true );
- updateActions(); //SRN: BugID IPAL9377, case 3
- }
- catch(...) {
+ if( so )
+ {
+ try {
+ stdDS->Paste(so);
+ updateObjectBrowser( true );
+ updateActions(); //SRN: BugID IPAL9377, case 3
+ }
+ catch(...) {
+ }
}
}
}
if ( !aFile.isEmpty() )
{
- QString command = QString("exec(open(\"%1\",encoding='utf-8').read())").arg(aFile);
+
+ QString command = QString("exec(open(\"%1\", \"rb\").read())").arg(aFile);
#ifndef DISABLE_PYCONSOLE
PyConsole_Console* pyConsole = pythonConsole();
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
// load study from the temporary directory
- QString command = QString( "exec(open(\"%1\",encoding='utf-8').read())" ).arg( theDumpScript );
+
+ QString command = QString( "exec(open(\"%1\" ,\"rb\").read())" ).arg( theDumpScript );
#ifndef DISABLE_PYCONSOLE
PyConsole_Console* pyConsole = app->pythonConsole();