- added a failsafe path to the source folder from which to copy the VisPy data

This commit is contained in:
Marius Stanciu
2019-08-15 15:54:39 +03:00
parent b9123e5a72
commit 0cdf96ad38
2 changed files with 6 additions and 1 deletions

View File

@@ -2154,7 +2154,11 @@ class App(QtCore.QObject):
"""
if os.path.exists(to_path):
shutil.rmtree(to_path)
shutil.copytree(from_path, to_path)
try:
shutil.copytree(from_path, to_path)
except FileNotFoundError:
from_new_path = os.path.dirname(os.path.realpath(__file__)) + '\\flatcamGUI\\VisPyData\\data'
shutil.copytree(from_new_path, to_path)
def set_ui_title(self, name):
self.ui.setWindowTitle('FlatCAM %s %s - %s %s' %