def number_format(self): _id = self.style_array.numFmtId if _id < BUILTIN_FORMATS_MAX_SIZE: return BUILTIN_FORMATS.get(_id, "General") else: return self.parent.parent._number_formats[_id - BUILTIN_FORMATS_MAX_SIZE]
def number_format(self): if not self.style_id: return _id = self.style_id.number_format if _id < 164: return BUILTIN_FORMATS.get(_id, "General") else: return self.parent.parent._number_formats[_id - 164]
def number_format(self): if not self.style_array: return _id = self.style_array.numFmtId if _id < 164: return BUILTIN_FORMATS.get(_id, "General") else: return self.parent.parent._number_formats[_id - 164]
def number_format(self): if not self.style_id: return _id = self.style_id.number_format if _id < 164: return BUILTIN_FORMATS.get(_id, "General") else: try: return self.parent.parent._number_formats[_id - 164] except IndexError: if self.parent.parent._number_formats: return self.parent.parent._number_formats[0] else: return None
def shared_styles(self): """ Legacy On the fly conversion of style references to style objects """ styles = [] for sid in self._cell_styles: font = self._fonts[sid.font] fill = self._fills[sid.fill] border = self._borders[sid.border] alignment = self._alignments[sid.alignment] protection = self._protections[sid.protection] nf_id = sid.number_format if nf_id < 164: number_format = BUILTIN_FORMATS.get(nf_id, "General") else: number_format = self._number_formats[sid.number_format - 164] styles.append(Style(font, fill, border, alignment, number_format, protection)) return styles
def shared_styles(self): """ Legacy On the fly conversion of style references to style objects """ styles = [] for sid in self._cell_styles: font = self._fonts[sid.font] fill = self._fills[sid.fill] border = self._borders[sid.fill] alignment = self._alignments[sid.alignment] protection = self._protections[sid.protection] nf_id = sid.number_format if nf_id < 164: number_format = BUILTIN_FORMATS.get(nf_id, "General") else: number_format = self._number_formats[sid.number_format - 164] styles.append(Style(font, fill, border, alignment, number_format, protection)) return styles