def getAvailableConnections(self):
return filter(lambda c: c.isAvailable(), self._connectionMap.values())
+ def remove(self, host):
+ del self._connectionMap[host]
+
def getIconID(self):
return 27
def getPriority(self):
return 100
- def __cmp__(self, other):
- return self.getPriority() - other.getPriority()
-
- def __repr__(self):
- return self.name
-
def _doodle3DThread(self):
self._waitDelay = 0
while True:
self.checkThread.start()
#Load the file into memory for printing.
- def loadFile(self, filename):
+ def loadGCodeData(self, dataStream):
if self._printing:
return False
self._fileBlocks = []
self._lineCount = 0
block = []
blockSize = 0
- f = open(filename, "r")
- for line in f:
+ for line in dataStream:
#Strip out comments, we do not need to send comments
if ';' in line:
line = line[:line.index(';')]
blockSize += len(line) + 1
block.append(line)
self._fileBlocks.append('\n'.join(block) + '\n')
- f.close()
self._doCallback()
return True
# The Doodle3D box could also be offline, if we reach a high enough errorCount then assume the box is gone.
self._errorCount += 1
if self._errorCount > 10:
- self._host = None
if self._isAvailable:
self._printing = False
self._isAvailable = False
self._doCallback()
self._sleep(15)
+ self._group.remove(self._host)
+ return
else:
self._sleep(3)
continue