-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathDesignSPHysics.FCMacro
More file actions
40 lines (32 loc) · 1.29 KB
/
DesignSPHysics.FCMacro
File metadata and controls
40 lines (32 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python3.7
# -*- coding: utf-8 -*-
""" This file acts as a bootstrapper to load DesignSPHysics from the
"Mod" folder of the FreeCAD install directory.
"""
import sys
import os
""" Disables some types of FreeCAD warnings """
from PySide2.QtCore import qInstallMessageHandler, QtMsgType
def customMessageHandler(type, context, message):
if "QWindowsWindow::setMouseGrabEnabled" not in message:
print(message)
qInstallMessageHandler(customMessageHandler)
os.environ["QT_LOGGING_RULES"] = "*.debug=false;*.warning=false"
# --------------------
import logging
class IgnoreMouseGrabWarning(logging.Filter):
def filter(self, record):
return "QWindowsWindow::setMouseGrabEnabled" not in record.getMessage()
logger = logging.getLogger()
logger.addFilter(IgnoreMouseGrabWarning)
# --------------------
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
# --------------------
from mod.main import boot # pylint: disable=wrong-import-position
'''
def report_error(exctype, value, tb):
""" Displays a dialog with options about the sudden crash. """
sys.__excepthook__(exctype, value, tb)
ErrorReportDialog(escape(str(exctype)), escape(str(value)), escape(''.join(format_tb(tb))))'''
#sys.excepthook = report_error
boot()