- improved the quit application process; now the quit_flatcam Tcl command works properly

This commit is contained in:
Marius Stanciu
2022-01-31 17:17:45 +02:00
committed by Marius
parent 7ac1ff6364
commit cc8f5cc27d
4 changed files with 53 additions and 28 deletions

View File

@@ -4,6 +4,7 @@
# Date: 8/17/2019 #
# MIT Licence #
# ##########################################################
import sys
from tclCommands.TclCommand import TclCommand
@@ -19,7 +20,7 @@ class TclCommandQuit(TclCommand):
"""
# List of all command aliases, to be able use old names for backward compatibility (add_poly, add_polygon)
aliases = ['quit_flatcam']
aliases = ['quit_app']
description = '%s %s' % ("--", "Tcl shell command to quit FlatCAM from Tcl shell.")
@@ -42,7 +43,7 @@ class TclCommandQuit(TclCommand):
'args': collections.OrderedDict([
]),
'examples': ['quit_flatcam']
'examples': ['quit_app']
}
def execute(self, args, unnamed_args):
@@ -53,4 +54,8 @@ class TclCommandQuit(TclCommand):
:return:
"""
self.app.quit_application(silent=True)
try:
self.app.quit_application(silent=True)
except Exception:
import os
os._exit(0)