-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathInit.py
More file actions
48 lines (40 loc) · 2.36 KB
/
Init.py
File metadata and controls
48 lines (40 loc) · 2.36 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
41
42
43
44
45
46
47
48
# SPDX-License-Identifier: LGPL-2.1-or-later
# SPDX-FileNotice: Part of the Telemetry addon.
################################################################################
# #
# © 2025 FreeCAD Project Association #
# #
# This addon is free software: you can redistribute it and/or modify #
# it under the terms of the GNU Lesser General Public License as #
# published by the Free Software Foundation, either version 2.1 #
# of the License, or (at your option) any later version. #
# #
# This addon is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty #
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
# See the GNU Lesser General Public License for more details. #
# #
# You should have received a copy of the GNU Lesser General Public #
# License along with this addon. If not, see https://www.gnu.org/licenses #
# #
################################################################################
import FreeCAD
# from Sentry import init_sentry, close_sentry_session
def setup_sentry():
global init_sentry
global close_sentry_session
params = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Telemetry")
dsn = params.GetString("DSN", "unset")
if dsn == "unset":
dsn = "https://ff3b28f395e6df9ba8fc4c34e03ffdc7@o4508819774963712.ingest.de.sentry.io/4508819779944528"
params.SetString("DSN", dsn)
enabled = params.GetBool("Enable", True)
if not enabled:
FreeCAD.Console.PrintLog(
"Sentry initializing, but FreeCAD Telemetry sending is disabled: no data will be transmitted\n"
)
dsn = None
else:
FreeCAD.Console.PrintLog("Sentry initializing. FreeCAD Telemetry sending is active.\n")
init_sentry(dsn=dsn)
# setup_sentry() # Currently not using Sentry