def test_writeLine(self): badName = "bad name_example-here" TSV = MantidQt.API.TSVSerialiser() pythonTSV.writeLine(TSV, badName) pi = 3.14159 TSV.storeDouble(pi) load = load_TSV(TSV) safeName = pythonTSV.makeLineNameSafe(badName) load.selectLine(safeName) self.assertEquals(pi, load.readDouble())
def save(self): # save .... TSVSec = MantidQt.API.TSVSerialiser() TSV0 = MantidQt.API.TSVSerialiser() keys = self.common_context.keys() TSV0.writeLine("keys") TSV0.storeInt(len(keys)) for key in keys: TSV0.storeString(key) for key in keys: TSVHelper.writeLine(TSV0, key) value = self.common_context[key] try: TSVHelper.saveToTSV(TSV0, value) except: try: self.saveCustom(TSV0, key, value) except: pass lines = TSV0.outputLines() safeName = TSVHelper.makeLineNameSafe(self._name) TSVSec.writeSection(safeName, lines) return TSVSec.outputLines()
def save(self, TSV): TSVHelper.writeLine(TSV, self._name) TSV.storeInt(len(self._dets)) for detector in self._dets: TSV.storeInt(detector)
def save(self, TSV): TSVHelper.writeLine(TSV, self._name) TSV.storeString(self._F_group) TSV.storeString(self._B_group) TSV.storeDouble(self._alpha)