Avoid crash at "import smesh_selection" in terminal mode

+ don't print useless mesh log
This commit is contained in:
eap 2018-08-24 18:47:47 +03:00
parent 8af480d893
commit 3fcd996c94
10 changed files with 22 additions and 19 deletions

View File

@ -172,8 +172,8 @@ ret = mesh.Compute()
if ret != 0:
log=mesh.GetLog(0) # no erase trace
for linelog in log:
print(linelog)
# for linelog in log:
# print(linelog)
print("Information about the Mesh_mechanic:")
print("Number of nodes : ", mesh.NbNodes())
print("Number of edges : ", mesh.NbEdges())

View File

@ -126,8 +126,8 @@ ret = mesh.Compute()
print(ret)
if ret != 0:
log = mesh.GetLog(0) # no erase trace
for linelog in log:
print(linelog)
# for linelog in log:
# print(linelog)
print("Information about the MeshBox2:")
print("Number of nodes : ", mesh.NbNodes())
print("Number of edges : ", mesh.NbEdges())

View File

@ -136,8 +136,8 @@ ret = mesh.Compute()
print(ret)
if ret != 0:
log = mesh.GetLog(0) # no erase trace
for linelog in log:
print(linelog)
# for linelog in log:
# print(linelog)
print("Information about the MeshBox3:")
print("Number of nodes : ", mesh.NbNodes())
print("Number of edges : ", mesh.NbEdges())

View File

@ -95,8 +95,8 @@ ret = mesh.Compute()
print(ret)
if ret != 0:
log = mesh.GetLog(0) # no erase trace
for linelog in log:
print(linelog)
# for linelog in log:
# print(linelog)
print("Information about the MeshBox:")
print("Number of nodes : ", mesh.NbNodes())
print("Number of edges : ", mesh.NbEdges())

View File

@ -87,8 +87,8 @@ ret = mesh.Compute()
print(ret)
if ret != 0:
log = mesh.GetLog(0) # no erase trace
for linelog in log:
print(linelog)
# for linelog in log:
# print(linelog)
print("Information about the MeshcompShel:")
print("Number of nodes : ", mesh.NbNodes())
print("Number of edges : ", mesh.NbEdges())

View File

@ -110,8 +110,8 @@ ret = mesh.Compute(mesh)
print(ret)
if ret != 0:
log = mesh.GetLog(0) # no erase trace
for linelog in log:
print(linelog)
# for linelog in log:
# print(linelog)
print("Information about the MeshcompShel:")
print("Number of nodes : ", mesh.NbNodes())
print("Number of edges : ", mesh.NbEdges())

View File

@ -96,8 +96,8 @@ ret = mesh.Compute()
print(ret)
if ret != 0:
log = mesh.GetLog(0) # no erase trace
for linelog in log:
print(linelog)
# for linelog in log:
# print(linelog)
print("Information about the Mesh_mechanic_tetra:")
print("Number of nodes : ", mesh.NbNodes())
print("Number of edges : ", mesh.NbEdges())

View File

@ -103,7 +103,7 @@ face = salome.IDToObject(idf)
ret = mesh.Compute(face)
print(ret)
log = mesh.GetLog(0) # 0 - GetLog without ClearLog after, else if 1 - ClearLog after
log = [] #mesh.GetLog(0) # 0 - GetLog without ClearLog after, else if 1 - ClearLog after
for a in log:
print("-------")
ii = 0

View File

@ -32,7 +32,7 @@ print("-------------------------- compute box")
ret = mesh.Compute()
print(ret)
log = mesh.GetLog(0); # no erase trace
for linelog in log:
print(linelog)
# for linelog in log:
# print(linelog)
salome.sg.updateObjBrowser()

View File

@ -564,8 +564,11 @@ void SMESH_Swig::init()
};
// load SMESH GUI if it's not yet loaded
ProcessVoidEvent( new TInitEvent() );
SMESHGUI::GetSMESHGen()->UpdateStudy();
if ( SUIT_Session::session() )
{
ProcessVoidEvent( new TInitEvent() );
SMESHGUI::GetSMESHGen()->UpdateStudy();
}
}
/////////////////////////////////////////////////////////////////