tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
cq-editor: use default version of spyder
Robert Schütz
4 years ago
cf4e702b
b51d8262
+63
-1
2 changed files
expand all
collapse all
unified
split
pkgs
applications
graphics
cq-editor
default.nix
spyder4.patch
+5
-1
pkgs/applications/graphics/cq-editor/default.nix
···
16
sha256 = "1970izjaa60r5cg9i35rzz9lk5c5d8q1vw1rh2skvfbf63z1hnzv";
17
};
18
0
0
0
0
19
propagatedBuildInputs = with python3Packages; [
20
cadquery
21
Logbook
22
pyqt5
23
pyparsing
24
pyqtgraph
25
-
spyder_3
26
pathpy
27
qtconsole
28
requests
···
16
sha256 = "1970izjaa60r5cg9i35rzz9lk5c5d8q1vw1rh2skvfbf63z1hnzv";
17
};
18
19
+
patches = [
20
+
./spyder4.patch
21
+
];
22
+
23
propagatedBuildInputs = with python3Packages; [
24
cadquery
25
Logbook
26
pyqt5
27
pyparsing
28
pyqtgraph
29
+
spyder
30
pathpy
31
qtconsole
32
requests
+58
pkgs/applications/graphics/cq-editor/spyder4.patch
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
diff --git a/cq_editor/widgets/debugger.py b/cq_editor/widgets/debugger.py
2
+
index b7398fb..d039db5 100644
3
+
--- a/cq_editor/widgets/debugger.py
4
+
+++ b/cq_editor/widgets/debugger.py
5
+
@@ -162,7 +162,7 @@ class Debugger(QObject,ComponentMixin):
6
+
7
+
def get_breakpoints(self):
8
+
9
+
- return self.parent().components['editor'].get_breakpoints()
10
+
+ return self.parent().components['editor'].debugger.get_breakpoints()
11
+
12
+
def compile_code(self,cq_script):
13
+
14
+
@@ -178,12 +178,14 @@ class Debugger(QObject,ComponentMixin):
15
+
def _exec(self, code, locals_dict, globals_dict):
16
+
17
+
with ExitStack() as stack:
18
+
- p = Path(self.parent().components['editor'].filename).dirname()
19
+
- if self.preferences['Add script dir to path'] and p:
20
+
+ fname = self.parent().components['editor'].filename
21
+
+ p = Path(fname if fname else '').abspath().dirname()
22
+
+ if self.preferences['Add script dir to path'] and p.exists():
23
+
sys.path.append(p)
24
+
stack.callback(sys.path.remove, p)
25
+
- if self.preferences['Change working dir to script dir'] and p:
26
+
+ if self.preferences['Change working dir to script dir'] and p.exists():
27
+
stack.enter_context(p)
28
+
+
29
+
exec(code, locals_dict, globals_dict)
30
+
31
+
def _inject_locals(self,module):
32
+
diff --git a/cq_editor/widgets/editor.py b/cq_editor/widgets/editor.py
33
+
index 45aa048..2763469 100644
34
+
--- a/cq_editor/widgets/editor.py
35
+
+++ b/cq_editor/widgets/editor.py
36
+
@@ -1,4 +1,4 @@
37
+
-from spyder.widgets.sourcecode.codeeditor import CodeEditor
38
+
+from spyder.plugins.editor.widgets.codeeditor import CodeEditor
39
+
from PyQt5.QtCore import pyqtSignal, QFileSystemWatcher, QTimer
40
+
from PyQt5.QtWidgets import QAction, QFileDialog
41
+
from PyQt5.QtGui import QFontDatabase
42
+
@@ -32,6 +32,8 @@ class Editor(CodeEditor,ComponentMixin):
43
+
44
+
def __init__(self,parent=None):
45
+
46
+
+ self._watched_file = None
47
+
+
48
+
super(Editor,self).__init__(parent)
49
+
ComponentMixin.__init__(self)
50
+
51
+
@@ -83,7 +85,6 @@ class Editor(CodeEditor,ComponentMixin):
52
+
53
+
# autoreload support
54
+
self._file_watcher = QFileSystemWatcher(self)
55
+
- self._watched_file = None
56
+
# we wait for 50ms after a file change for the file to be written completely
57
+
self._file_watch_timer = QTimer(self)
58
+
self._file_watch_timer.setInterval(50)