summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2020-08-13 18:54:57 +0200
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2020-08-13 18:54:57 +0200
commit932b6dc8ead8707fc7b4556aff4b501a4475f61c (patch)
tree2105623862aa92aed507ff69a9d7e9eb173e4ebc /plugin
parente126ace7a25f585d3b853c62613f1f4a70e062fa (diff)
downloadkimesh-932b6dc8ead8707fc7b4556aff4b501a4475f61c.tar.gz
kimesh-932b6dc8ead8707fc7b4556aff4b501a4475f61c.tar.bz2
kimesh-932b6dc8ead8707fc7b4556aff4b501a4475f61c.zip
WIP
Diffstat (limited to 'plugin')
-rw-r--r--plugin/mesh_dialog.py10
-rw-r--r--plugin/mesh_plugin.py28
2 files changed, 10 insertions, 28 deletions
diff --git a/plugin/mesh_dialog.py b/plugin/mesh_dialog.py
index 84e2fd8..97943a8 100644
--- a/plugin/mesh_dialog.py
+++ b/plugin/mesh_dialog.py
@@ -1,8 +1,12 @@
+from collections import defaultdict
+
import wx
-import mesh_plugin_dialog
+
import pcbnew
-from collections import defaultdict
-import pyclipper
+
+import shapely
+
+from . import mesh_plugin_dialog
# Implementing MainDialog
class MeshPluginMainDialog(mesh_plugin_dialog.MainDialog):
diff --git a/plugin/mesh_plugin.py b/plugin/mesh_plugin.py
index 2208297..9d4ab56 100644
--- a/plugin/mesh_plugin.py
+++ b/plugin/mesh_plugin.py
@@ -15,31 +15,9 @@ def check_requirements(*packages):
missing.append(pkg)
if missing:
- if 'win' not in sys.platform:
- wx.MessageDialog(None, "Error: Missing python dependencies {}.".format(', '.join(missing)),
- "Missing Dependencies").ShowModal()
- return False
-
- else:
- msg = 'The following python dependencies are missing:\n\n' + '\n'.join(missing) +\
- '\n\nShould we go ahead and install these missing dependencies into the plugin directory?'
- dialog = wx.MessageDialog(None, msg, caption='Error: Missing dependencies', style=wx.YES_NO | wx.NO_DEFAULT)
- dialog.SetYesNoLabels("Install missing dependencies", "Cancel")
- if dialog.ShowModal() == wx.ID_YES:
- for dep in packages:
- proc = subprocess.Popen(
- "pip install --target deps {} --no-use-pep517 --only-binary :all: --platform win_amd64"\
- .format(dep).split(),
- cwd=path.dirname(__file__),
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- (stdout, stderr) = proc.communicate()
- if proc.returncode != 0:
- wx.MessageDialog(None, "Error installing dependencies:\n\n{}\n{}".format(stdout, stderr),
- "Installation Error").ShowModal()
- return False
-
- sys.path.append(path.abspath(path.join(path.dirname(__file__), 'deps')))
+ wx.MessageDialog(None, "Error: Missing python dependencies:\n\n{}.".format('\n'.join(missing)),
+ "Missing Dependencies").ShowModal()
+ return False
else:
return True