Fixed conflict with PyQt5. Cleanup. Log level back to debug.
This commit is contained in:
parent
35754aa2b5
commit
aa951e277b
|
@ -51,8 +51,8 @@ class App(QtCore.QObject):
|
||||||
|
|
||||||
## Logging ##
|
## Logging ##
|
||||||
log = logging.getLogger('base')
|
log = logging.getLogger('base')
|
||||||
#log.setLevel(logging.DEBUG)
|
log.setLevel(logging.DEBUG)
|
||||||
log.setLevel(logging.WARNING)
|
#log.setLevel(logging.WARNING)
|
||||||
formatter = logging.Formatter('[%(levelname)s][%(threadName)s] %(message)s')
|
formatter = logging.Formatter('[%(levelname)s][%(threadName)s] %(message)s')
|
||||||
handler = logging.StreamHandler()
|
handler = logging.StreamHandler()
|
||||||
handler.setFormatter(formatter)
|
handler.setFormatter(formatter)
|
||||||
|
@ -690,7 +690,6 @@ class App(QtCore.QObject):
|
||||||
self.defaults["def_win_w"] = width
|
self.defaults["def_win_w"] = width
|
||||||
self.defaults["def_win_h"] = height
|
self.defaults["def_win_h"] = height
|
||||||
self.save_defaults()
|
self.save_defaults()
|
||||||
print self.defaults
|
|
||||||
|
|
||||||
def message_dialog(self, title, message, kind="info"):
|
def message_dialog(self, title, message, kind="info"):
|
||||||
icon = {"info": QtGui.QMessageBox.Information,
|
icon = {"info": QtGui.QMessageBox.Information,
|
||||||
|
|
|
@ -7,6 +7,11 @@
|
||||||
############################################################
|
############################################################
|
||||||
|
|
||||||
from PyQt4 import QtGui, QtCore
|
from PyQt4 import QtGui, QtCore
|
||||||
|
|
||||||
|
# Prevent conflict with Qt5 and above.
|
||||||
|
from matplotlib import use as mpl_use
|
||||||
|
mpl_use("Qt4Agg")
|
||||||
|
|
||||||
from matplotlib.figure import Figure
|
from matplotlib.figure import Figure
|
||||||
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
|
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
|
||||||
import FlatCAMApp
|
import FlatCAMApp
|
||||||
|
@ -264,8 +269,8 @@ class PlotCanvas:
|
||||||
|
|
||||||
# Adjust axes
|
# Adjust axes
|
||||||
for ax in self.figure.get_axes():
|
for ax in self.figure.get_axes():
|
||||||
ax.set_xlim((xmin + x*width, xmax + x*width))
|
ax.set_xlim((xmin + x * width, xmax + x * width))
|
||||||
ax.set_ylim((ymin + y*height, ymax + y*height))
|
ax.set_ylim((ymin + y * height, ymax + y * height))
|
||||||
|
|
||||||
# Re-draw
|
# Re-draw
|
||||||
self.canvas.draw()
|
self.canvas.draw()
|
||||||
|
@ -302,7 +307,7 @@ class PlotCanvas:
|
||||||
if event.button == 'up':
|
if event.button == 'up':
|
||||||
self.zoom(1.5, self.mouse)
|
self.zoom(1.5, self.mouse)
|
||||||
else:
|
else:
|
||||||
self.zoom(1/1.5, self.mouse)
|
self.zoom(1 / 1.5, self.mouse)
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.key == 'shift':
|
if self.key == 'shift':
|
||||||
|
|
|
@ -43,8 +43,8 @@ import simplejson as json
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
log = logging.getLogger('base2')
|
log = logging.getLogger('base2')
|
||||||
#log.setLevel(logging.DEBUG)
|
log.setLevel(logging.DEBUG)
|
||||||
log.setLevel(logging.WARNING)
|
#log.setLevel(logging.WARNING)
|
||||||
#log.setLevel(logging.INFO)
|
#log.setLevel(logging.INFO)
|
||||||
formatter = logging.Formatter('[%(levelname)s] %(message)s')
|
formatter = logging.Formatter('[%(levelname)s] %(message)s')
|
||||||
handler = logging.StreamHandler()
|
handler = logging.StreamHandler()
|
||||||
|
|
Loading…
Reference in New Issue