Ejemplo n.º 1
0
 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())
Ejemplo n.º 2
0
 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())
Ejemplo n.º 3
0
    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()
Ejemplo n.º 4
0
 def save(self, TSV):
     TSVHelper.writeLine(TSV, self._name)
     TSV.storeInt(len(self._dets))
     for detector in self._dets:
         TSV.storeInt(detector)
Ejemplo n.º 5
0
 def save(self, TSV):
     TSVHelper.writeLine(TSV, self._name)
     TSV.storeString(self._F_group)
     TSV.storeString(self._B_group)
     TSV.storeDouble(self._alpha)
Ejemplo n.º 6
0
 def save(self, TSV):
     TSVHelper.writeLine(TSV, self._name)
     TSV.storeString(self._F_group)
     TSV.storeString(self._B_group)
     TSV.storeDouble(self._alpha)
Ejemplo n.º 7
0
 def save(self, TSV):
     TSVHelper.writeLine(TSV, self._name)
     TSV.storeInt(len(self._dets))
     for detector in self._dets:
         TSV.storeInt(detector)