Просмотр исходного кода

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

Marius Stanciu 6 лет назад
Родитель
Сommit
0cdf96ad38
2 измененных файлов с 6 добавлено и 1 удалено
  1. 5 1
      FlatCAMApp.py
  2. 1 0
      README.md

+ 5 - 1
FlatCAMApp.py

@@ -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' %

+ 1 - 0
README.md

@@ -18,6 +18,7 @@ CAD program, and create G-Code for Isolation routing.
 - stored inside FlatCAM app the VisPy data files and at the first start the application will try to copy those files to the APPDATA (roaming) folder in case of running under Windows OS
 - created a configuration file in the root/config/configuration.txt with a configuration line for portability. Set portable to True to run the app as portable
 - working on the Slots Array in Excellon Editor - building the GUI
+- added a failsafe path to the source folder from which to copy the VisPy data
 
 14.08.2019