- made a hack so if the Image Import plugin can't be loaded due of dependencies errors the app will not crash but this plugin will no longer be available

This commit is contained in:
Marius Stanciu
2022-01-19 18:05:13 +02:00
parent 8d06b5bf81
commit a26fd24f65
4 changed files with 14 additions and 10 deletions

View File

@@ -17,7 +17,7 @@ CHANGELOG for FlatCAM beta
- in Geometry object the default self.options dictionary is updated with keys that reflect new data structure - in Geometry object the default self.options dictionary is updated with keys that reflect new data structure
- added comments in the `default` preprocessors which will help other people create their own preprocessors - added comments in the `default` preprocessors which will help other people create their own preprocessors
- remade the Image Import plugin in an attempt to fix issues with the latest packages of Gdal and Rasterio but it looks that it is a conflict between the Rasterio 1.2.10, Gdal 3.4.1 and Shapely 1.8.0 - remade the Image Import plugin in an attempt to fix issues with the latest packages of Gdal and Rasterio but it looks that it is a conflict between the Rasterio 1.2.10, Gdal 3.4.1 and Shapely 1.8.0
- made a hack so if the Image Import plugin can't be loaded due of dependencies errors the app will not crash but this plugin will no longer be available
18.01.2022 18.01.2022

View File

@@ -4,10 +4,8 @@
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
# ########################################################## # ##########################################################
import sys
from PyQt6 import QtGui, QtWidgets from PyQt6 import QtGui, QtWidgets
import os import os, sys
from shapely.geometry import shape from shapely.geometry import shape
from shapely.ops import unary_union from shapely.ops import unary_union
@@ -15,7 +13,7 @@ from shapely.affinity import scale, translate
import numpy as np import numpy as np
# import rasterio import rasterio
from rasterio import open as rasterio_open from rasterio import open as rasterio_open
from rasterio.features import shapes from rasterio.features import shapes

View File

@@ -7,7 +7,10 @@ from appPlugins.ToolAlignObjects import AlignObjects
from appPlugins.ToolFilm import Film from appPlugins.ToolFilm import Film
from appPlugins.ToolImage import ToolImage try:
from appPlugins.ToolImage import ToolImage
except ImportError:
pass
from appPlugins.ToolDistance import Distance from appPlugins.ToolDistance import Distance
from appPlugins.ToolObjectDistance import ObjectDistance from appPlugins.ToolObjectDistance import ObjectDistance

View File

@@ -1998,10 +1998,13 @@ class App(QtCore.QObject):
pos=self.ui.menufileimport, pos=self.ui.menufileimport,
separator=True) separator=True)
try:
self.image_tool = ToolImage(self) self.image_tool = ToolImage(self)
self.image_tool.install(icon=QtGui.QIcon(self.resource_location + '/image32.png'), self.image_tool.install(icon=QtGui.QIcon(self.resource_location + '/image32.png'),
pos=self.ui.menufileimport, pos=self.ui.menufileimport,
separator=True) separator=True)
except Exception:
self.image_tool = lambda x: None
self.pcb_wizard_tool = PcbWizard(self) self.pcb_wizard_tool = PcbWizard(self)
self.pcb_wizard_tool.install(icon=QtGui.QIcon(self.resource_location + '/drill32.png'), self.pcb_wizard_tool.install(icon=QtGui.QIcon(self.resource_location + '/drill32.png'),