chiark / gitweb /
Add black borders around the white text, so it pops out more.
[cura.git] / Cura / util / gcodeInterpreter.py
index 901595c74f657acef0e06d702e3d4e82a4a23a0a..c9a2b3eacebb357a157912a4b2cc7ce8865fbf28 100644 (file)
@@ -261,7 +261,7 @@ class gcode(object):
                                        else:
                                                print "Unknown M code:" + str(M)
                self.layerList.append(currentLayer)
-               if self.progressCallback is not None:
+               if self.progressCallback is not None and self._fileSize > 0:
                        self.progressCallback(float(gcodeFile.tell()) / float(self._fileSize))
                self.extrusionAmount = maxExtrusion
                self.totalMoveTimeMinute = totalMoveTimeMinute
@@ -272,7 +272,7 @@ class gcode(object):
                if code not in self.regMatch:
                        self.regMatch[code] = re.compile(code + '([^\s]+)')
                m = self.regMatch[code].search(line)
-               if m == None:
+               if m is None:
                        return None
                try:
                        return int(m.group(1))