def DummyCell(dummy_sheet): dummy_sheet.parent._number_formats.add('d-mmm-yy') style = StyleArray([0, 0, 0, 164, 0, 0, 0, 0, 0]) dummy_sheet.parent._cell_styles.add(style) cell = ReadOnlyCell(dummy_sheet, None, None, "23596", 'n', 1) return cell
def __init__(self): self._differential_styles = [] self.shared_strings = IndexedList() self.shared_strings.add("hello world") self._fonts = IndexedList() self._fills = IndexedList() self._number_formats = IndexedList() self._borders = IndexedList() self._alignments = IndexedList() self._protections = IndexedList() self._cell_styles = IndexedList() self.vba_archive = None for i in range(29): self._cell_styles.add((StyleArray([i]*9))) self._cell_styles.add(StyleArray([0,4,6,0,0,1,0,0,0])) #fillId=4, borderId=6, alignmentId=1)) self.sheetnames = []
def __init__(self): self.shared_strings = IndexedList() self._cell_styles = IndexedList( [StyleArray([0, 0, 0, 0, 0, 0, 0, 0, 0])]) self._number_formats = IndexedList() self.encoding = "UTF-8" self.epoch = CALENDAR_WINDOWS_1900 self.sheetnames = []
class DummyWorkbook(object): shared_styles = IndexedList() style = StyleArray() shared_styles.add(style) # Workbooks always have a default style _cell_styles = IndexedList() _cell_styles.add(style) _number_formats = IndexedList() _fonts = IndexedList() _fonts.add(None)
def __init__(self): self._differential_styles = [] self.shared_strings = IndexedList() self._fonts = IndexedList() self._fills = IndexedList() self._number_formats = IndexedList() self._borders = IndexedList() self._alignments = IndexedList() self._protections = IndexedList() self._cell_styles = IndexedList() self.vba_archive = None self._cell_styles.add(StyleArray([0, 0, 0, 14, 0, 0, 0, 0, 0])) self.sheetnames = []
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 = []
class Workbook: epoch = None _cell_styles = [StyleArray([0, 0, 0, 0, 0, 0, 0, 0, 0])] def __init__(self): self.sheetnames = []
def test_style_array(self, dummy_sheet): cell = ReadOnlyCell(dummy_sheet, None, None, None) assert cell.style_array == StyleArray()