8000 add log() function to the built-in CQ-editor console (#360) · ag-python-qt/CQ-editor-pyqt@e66d792 · GitHub
[go: up one dir, main page]

Skip to content

Commit e66d792

Browse files
authored
add log() function to the built-in CQ-editor console (CadQuery#360)
* add log() function to the built-in CQ-editor console * Move new logbook import to top of main_window.py
1 parent 774c3c6 commit e66d792

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cq_editor/main_window.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22

33
from PyQt5.QtWidgets import (QLabel, QMainWindow, QToolBar, QDockWidget, QAction)
4-
4+
from logbook import Logger
55
import cadquery as cq
66

77
from .widgets.editor import Editor
@@ -269,14 +269,15 @@ def prepare_console(self):
269269

270270
console = self.components['console']
271271
obj_tree = self.components['object_tree']
272-
272+
273273
#application related items
274274
console.push_vars({'self' : self})
275275

276276
#CQ related items
277277
console.push_vars({'show' : obj_tree.addObject,
278278
'show_object' : obj_tree.addObject,
279-
'cq' : cq})
279+
'cq' : cq,
280+
'log' : Logger(self.name).info})
280281

281282
def fill_dummy(self):
282283

0 commit comments

Comments
 (0)
0