def _logClsend(self, senderId, dataStr): msgStream = StringStream() simbase.air.describeMessage(msgStream, '', dataStr) readableStr = msgStream.getData() sstream = StringStream() PyDatagram(dataStr).dumpHex(sstream) hexDump = sstream.getData() self.clsendNotify.info('%s [%s]: %s%s' % (self.doId, self._clsendCounter, readableStr, hexDump))
def _logClsend(self, senderId, dataStr): msgStream = StringStream() simbase.air.describeMessage(msgStream, '', dataStr) readableStr = msgStream.getData() sstream = StringStream() PyDatagram(dataStr).dumpHex(sstream) hexDump = sstream.getData() self.clsendNotify.info( '%s [%s]: %s%s' % (self.doId, self._clsendCounter, readableStr, hexDump))
def paintEvent(self, event): screenData = StringStream() # Used to pass the data as a string screenImage = PNMImage() # Converts the texture data into a format usable with Qt if self.pandaTexture.hasRamImage(): print "Should draw yes?" self.pandaTexture.store(screenImage) screenImage.write(screenData, "test.ppm") self.paintPixmap.loadFromData(screenData.getData()) self.paintSurface.setPixmap(self.paintPixmap)
def test_loader(self): store = DNAStorage() np = self.loader.loadDNAFile(store, Filename('test.pdna')) self.check_store(store) expected_repr = '''PandaNode dna PandaNode root PandaNode test PandaNode 1000 PandaNode subgroup ModelNode prop_test T:(pos -12 5 7 hpr 180 15 0) S:(ColorScaleAttrib) PandaNode tb3:test_block [DNACode] PandaNode sb3:test_block''' ss = StringStream() np.ls(ss) self.assertEqual(ss.getData().strip(), expected_repr)
def test_loader(self): store = DNAStorage() np = self.loader.loadDNAFile(store, Filename("test.pdna")) self.check_store(store) expected_repr = """PandaNode dna PandaNode root PandaNode test PandaNode 1000 PandaNode subgroup ModelNode prop_test T:(pos -12 5 7 hpr 180 15 0) S:(ColorScaleAttrib) PandaNode tb3:test_block [DNACode] PandaNode sb3:test_block""" ss = StringStream() np.ls(ss) self.assertEqual(ss.getData().strip(), expected_repr)