Path: Allow PostUtils to be used in CLI mode
This commit is contained in:
parent
b195afc8ca
commit
6f89398b07
|
@ -27,9 +27,12 @@ These are a common functions and classes for creating custom post processors.
|
|||
'''
|
||||
|
||||
from PySide import QtCore, QtGui
|
||||
import FreeCADGui
|
||||
import FreeCAD
|
||||
|
||||
FreeCADGui = None
|
||||
if FreeCAD.GuiUp:
|
||||
import FreeCADGui
|
||||
|
||||
class OldHighlighter(QtGui.QSyntaxHighlighter):
|
||||
def highlightBlock(self, text):
|
||||
myClassFormat = QtGui.QTextCharFormat()
|
||||
|
@ -76,7 +79,9 @@ class GCodeHighlighter(QtGui.QSyntaxHighlighter):
|
|||
|
||||
|
||||
class GCodeEditorDialog(QtGui.QDialog):
|
||||
def __init__(self, parent = FreeCADGui.getMainWindow()):
|
||||
def __init__(self, parent = None):
|
||||
if parent is None:
|
||||
parent = FreeCADGui.getMainWindow()
|
||||
QtGui.QDialog.__init__(self,parent)
|
||||
|
||||
layout = QtGui.QVBoxLayout(self)
|
||||
|
|
Loading…
Reference in New Issue
Block a user