def _setup_styles(self): """Bootstrap styles""" self._fonts = IndexedList() self._fonts.add(DEFAULT_FONT) self._alignments = IndexedList([Alignment()]) self._borders = IndexedList() self._borders.add(DEFAULT_BORDER) self._fills = IndexedList() self._fills.add(DEFAULT_EMPTY_FILL) self._fills.add(DEFAULT_GRAY_FILL) self._number_formats = IndexedList() self._protections = IndexedList([Protection()]) self._colors = COLOR_INDEX self._cell_styles = IndexedList([StyleArray()]) self._named_styles = NamedStyleList() self.add_named_style(NamedStyle(font=copy(DEFAULT_FONT), builtinId=0)) self._table_styles = TableStyleList()
def __init__(self): self.shared_styles = IndexedList() self._cell_styles = IndexedList() self._cell_styles.add(StyleArray()) self._cell_styles.add(StyleArray([10, 0, 0, 0, 0, 0, 0, 0, 0, 0])) self.sheetnames = []
def __init__(self): self.shared_styles = [Style()] self._cell_styles = IndexedList()
def read_string_table(xml_source): """Read in all shared strings in the table""" root = fromstring(text=xml_source) nodes = safe_iterator(root, '{%s}si' % SHEET_MAIN_NS) strings = (get_string(node) for node in nodes) return IndexedList(strings)
def __init__(self, sheet): self.sheet = sheet self.authors = IndexedList() self.comments = [] self.extract_comments()
class DummyWorkbook(object): shared_styles = IndexedList() shared_styles.add(None) # Workbooks always have a default style _cell_styles = IndexedList() _cell_styles.add(None) _number_formats = IndexedList()
def number_formats(self): fmts = [n.formatCode for n in self.numFmts.numFmt] return IndexedList(fmts)
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.links = IndexedList()
def __init__(self): self.shared_styles = [Style()] self._cell_styles = IndexedList() self._differential_styles = [] self.sheetnames = []
def __init__(self): self._differential_styles = [] self.shared_styles = IndexedList() self.worksheets = []