def _addGlyphName(self, sender): glyphName = sender.get() if glyphName in RamsayStData.keys(): index = 0 for item in self.w.dataList: if glyphName == item.glyphName(): break index += 1 self.w.dataList.setSelection([index]) return self.w.dataList.append(RamsayStData.newItem(glyphName))
def _exportGlyphNames(self, path): if path is None: return output = [ "# Ramsay St. Glyph List", "# <glyphName> <leftGlyphName> <rightGlyphGlyphName>" ] for glyphName in sorted(RamsayStData.keys()): value = RamsayStData.get(glyphName, None) if value is not None: output.append("%s %s %s" % (glyphName, value[0], value[1])) f = open(path, "w") f.write("\n".join(output)) f.close()