/usr/lib/python2.6/site-packages/tablib/packages/xlwt
NameSizeModeActions
antlr.py842010644editdlrm
antlr.pyc1004180644editdlrm
BIFFRecords.py946220644editdlrm
BIFFRecords.pyc1126670644editdlrm
Bitmap.py104130644editdlrm
Bitmap.pyc77230644editdlrm
Cell.py85260644editdlrm
Cell.pyc79210644editdlrm
Column.py10110644editdlrm
Column.pyc17950644editdlrm
CompoundDoc.py190850644editdlrm
CompoundDoc.pyc136950644editdlrm
ExcelFormula.py13850644editdlrm
ExcelFormula.pyc23570644editdlrm
ExcelFormulaLexer.py42050644editdlrm
ExcelFormulaLexer.pyc48390644editdlrm
ExcelFormulaParser.py223620644editdlrm
ExcelFormulaParser.pyc157160644editdlrm
ExcelMagic.py288400644editdlrm
ExcelMagic.pyc301390644editdlrm
Formatting.py83470755editdlrm
Formatting.pyc89450644editdlrm
Row.py98540644editdlrm
Row.pyc107060644editdlrm
Style.py190220644editdlrm
Style.pyc167860644editdlrm
UnicodeUtils.py33780644editdlrm
UnicodeUtils.pyc34620644editdlrm
Utils.py64740644editdlrm
Utils.pyc54940644editdlrm
Workbook.py205140644editdlrm
Workbook.pyc261670644editdlrm
Worksheet.py425960644editdlrm
Worksheet.pyc493920644editdlrm
__init__.py3050644editdlrm
__init__.pyc6260644editdlrm
Edit: /usr/lib/python2.6/site-packages/tablib/packages/xlwt/Cell.py (8526B)
# -*- coding: windows-1252 -*- from struct import unpack, pack import BIFFRecords class StrCell(object): __slots__ = ["rowx", "colx", "xf_idx", "sst_idx"] def __init__(self, rowx, colx, xf_idx, sst_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.sst_idx = sst_idx def get_biff_data(self): # return BIFFRecords.LabelSSTRecord(self.rowx, self.colx, self.xf_idx, self.sst_idx).get() return pack('<5HL', 0x00FD, 10, self.rowx, self.colx, self.xf_idx, self.sst_idx) class BlankCell(object): __slots__ = ["rowx", "colx", "xf_idx"] def __init__(self, rowx, colx, xf_idx): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx def get_biff_data(self): # return BIFFRecords.BlankRecord(self.rowx, self.colx, self.xf_idx).get() return pack('<5H', 0x0201, 6, self.rowx, self.colx, self.xf_idx) class MulBlankCell(object): __slots__ = ["rowx", "colx1", "colx2", "xf_idx"] def __init__(self, rowx, colx1, colx2, xf_idx): self.rowx = rowx self.colx1 = colx1 self.colx2 = colx2 self.xf_idx = xf_idx def get_biff_data(self): return BIFFRecords.MulBlankRecord(self.rowx, self.colx1, self.colx2, self.xf_idx).get() class NumberCell(object): __slots__ = ["rowx", "colx", "xf_idx", "number"] def __init__(self, rowx, colx, xf_idx, number): self.rowx = rowx self.colx = colx self.xf_idx = xf_idx self.number = float(number) def get_encoded_data(self): rk_encoded = 0 num = self.number # The four possible kinds of RK encoding are *not* mutually exclusive. # The 30-bit integer variety picks up the most. # In the code below, the four varieties are checked in descending order # of bangs per buck, or not at all. # SJM 2007-10-01 if -0x20000000 <= num < 0x20000000: # fits in 30-bit *signed* int inum = int(num) if inum == num: # survives round-trip # print "30-bit integer RK", inum, hex(inum) rk_encoded = 2 | (inum << 2) return 1, rk_encoded temp = num * 100 if -0x20000000 <= temp < 0x20000000: # That was step 1: the coded value will fit in # a 30-bit signed integer. itemp = int(round(temp, 0)) # That was step 2: "itemp" is the best candidate coded value. # Now for step 3: simulate the decoding, # to check for round-trip correctness. if itemp / 100.0 == num: # print "30-bit integer RK*100", itemp, hex(itemp) rk_encoded = 3 | (itemp << 2) return 1, rk_encoded if 0: # Cost of extra pack+unpack not justified by tiny yield. packed = pack('