- fixed some log errors

This commit is contained in:
Marius Stanciu 2019-07-08 22:42:58 +03:00
parent 769f92147a
commit 16525a606c
2 changed files with 10 additions and 12 deletions

View File

@ -243,7 +243,7 @@ class FloatEntry(QtWidgets.QLineEdit):
try:
evaled = eval(raw)
except Exception as e:
if evaled is not None:
if raw is not '':
log.error("Could not evaluate val: %s, error: %s" % (str(raw), str(e)))
return None
@ -286,7 +286,7 @@ class FloatEntry2(QtWidgets.QLineEdit):
try:
evaled = eval(raw)
except Exception as e:
if evaled is not None:
if raw is not '':
log.error("Could not evaluate val: %s, error: %s" % (str(raw), str(e)))
return None
@ -459,7 +459,7 @@ class EvalEntry(QtWidgets.QLineEdit):
try:
evaled = eval(raw)
except Exception as e:
if evaled is not None:
if raw is not '':
log.error("Could not evaluate val: %s, error: %s" % (str(raw), str(e)))
return None
return evaled
@ -498,7 +498,7 @@ class EvalEntry2(QtWidgets.QLineEdit):
try:
evaled = eval(raw)
except Exception as e:
if evaled is not None:
if raw is not '':
log.error("Could not evaluate val: %s, error: %s" % (str(raw), str(e)))
return None
return evaled
@ -785,7 +785,7 @@ class FCInputDialog(QtWidgets.QInputDialog):
def get_value(self):
self.val, self.ok = self.getDouble(self, self.title, self.text, min=self.min,
max=self.max, decimals=self.decimals, value=self.init_value)
max=self.max, decimals=self.decimals, value=self.init_value)
return [self.val, self.ok]
# "Transform", "Enter the Angle value:"
@ -1449,7 +1449,7 @@ class FCTable(QtWidgets.QTableWidget):
width += self.columnWidth(i)
return width
# color is in format QtGui.Qcolor(r, g, b, alfa) with or without alfa
# color is in format QtGui.Qcolor(r, g, b, alpha) with or without alpfa
def setColortoRow(self, rowIndex, color):
for j in range(self.columnCount()):
self.item(rowIndex, j).setBackground(color)
@ -1625,7 +1625,6 @@ class Dialog_box(QtWidgets.QWidget):
self.readyToEdit = True
class _BrowserTextEdit(QTextEdit):
def __init__(self, version):
@ -1641,7 +1640,6 @@ class _BrowserTextEdit(QTextEdit):
clear_action.triggered.connect(self.clear)
self.menu.exec_(event.globalPos())
def clear(self):
QTextEdit.clear(self)
text = "FlatCAM %s (c)2014-2019 Juan Pablo Caram (Type help to get started)\n\n" % self.version

View File

@ -421,10 +421,10 @@ class CutOut(FlatCAMTool):
object_geo = unary_union(object_geo)
# for geo in object_geo:
if isinstance(cutout_obj, FlatCAMGerber):
geo = (object_geo.buffer(margin + abs(dia / 2))).exterior
geo = object_geo.buffer(margin + abs(dia / 2))
geo = geo.exterior
else:
geo = object_geo
@ -438,9 +438,9 @@ class CutOut(FlatCAMTool):
if gaps == '8' or gaps == '2LR':
geo = self.subtract_poly_from_geo(geo,
xmin - gapsize, # botleft_x
xmin - gapsize, # botleft_x
py - gapsize + leny / 4, # botleft_y
xmax + gapsize, # topright_x
xmax + gapsize, # topright_x
py + gapsize + leny / 4) # topright_y
geo = self.subtract_poly_from_geo(geo,
xmin - gapsize,