Lines Matching refs:conv
559 for conv in cls.converters:
560 size = conv.getRecordSize(reader)
563 if conv.repeat:
564 if conv.repeat in reader:
565 countValue = reader[conv.repeat]
578 for conv in self.getConverters():
579 if conv.repeat:
580 if not hasattr(self, conv.name):
581 setattr(self, conv.name, [])
582 countValue = len(getattr(self, conv.name)) - conv.aux
584 count_conv = self.getConverterByName(conv.repeat)
585 setattr(self, conv.repeat, countValue)
587 # conv.repeat is a propagated count
588 if propagator and conv.repeat in propagator:
589 propagator[conv.repeat].setValue(countValue)
591 if conv.aux and not eval(conv.aux, None, self.__dict__):
593 if hasattr(self, conv.name):
595 if hasattr(conv, 'writeNullOffset'):
596 setattr(self, conv.name, None) # Warn?
597 #elif not conv.isCount:
605 for conv in self.getConverters():
606 if conv.name == "SubTable":
607 conv = conv.getConverter(reader.tableTag,
609 if conv.name == "ExtSubTable":
610 conv = conv.getConverter(reader.tableTag,
612 if conv.name == "FeatureParams":
613 conv = conv.getConverter(reader["FeatureTag"])
614 if conv.name == "SubStruct":
615 conv = conv.getConverter(reader.tableTag,
618 if conv.repeat:
619 if isinstance(conv.repeat, int):
620 countValue = conv.repeat
621 elif conv.repeat in table:
622 countValue = table[conv.repeat]
624 # conv.repeat is a propagated count
625 countValue = reader[conv.repeat]
626 countValue += conv.aux
627 table[conv.name] = conv.readArray(reader, font, table, countValue)
629 if conv.aux and not eval(conv.aux, None, table):
631 table[conv.name] = conv.read(reader, font, table)
632 if conv.isPropagated:
633 reader[conv.name] = table[conv.name]
635 name = conv.name
664 for conv in self.getConverters():
665 value = table.get(conv.name) # TODO Handle defaults instead of defaulting to None!
666 if conv.repeat:
669 countValue = len(value) - conv.aux
670 if isinstance(conv.repeat, int):
671 assert len(value) == conv.repeat, 'expected %d values, got %d' % (conv.repeat, len(value))
672 elif conv.repeat in table:
673 CountReference(table, conv.repeat, value=countValue)
675 # conv.repeat is a propagated count
676 writer[conv.repeat].setValue(countValue)
680 conv.write(writer, font, table, value, i)
682 name = value.__class__.__name__ if value is not None else conv.name
685 elif conv.isCount:
693 ref = writer.writeCountReference(table, conv.name, conv.staticSize)
694 table[conv.name] = None
695 if conv.isPropagated:
696 writer[conv.name] = ref
697 elif conv.isLookupType:
701 if conv.name not in table:
702 table[conv.name] = None
703 ref = writer.writeCountReference(table, conv.name, conv.staticSize, table[conv.name])
706 if conv.aux and not eval(conv.aux, None, table):
709 conv.write(writer, font, table, value)
711 name = value.__class__.__name__ if value is not None else conv.name
714 if conv.isPropagated:
715 writer[conv.name] = value
739 for conv in self.getConverters():
740 if conv.repeat:
741 value = getattr(self, conv.name, [])
744 conv.xmlWrite(xmlWriter, font, item, conv.name,
747 if conv.aux and not eval(conv.aux, None, vars(self)):
749 value = getattr(self, conv.name, None) # TODO Handle defaults instead of defaulting to None!
750 conv.xmlWrite(xmlWriter, font, value, conv.name, [])
754 conv = self.getConverterByName(name)
757 value = conv.xmlRead(attrs, content, font)
758 if conv.repeat:
759 seq = getattr(self, conv.name, None)
762 setattr(self, conv.name, seq)
765 setattr(self, conv.name, value)