/usr/lib/python2.7/dist-packages/openpyxl/styles/table.py is in python-openpyxl 2.4.9-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Typed,
Float,
Bool,
Set,
Integer,
NoneSet,
String,
Sequence
)
from .colors import Color
class TableStyleElement(Serialisable):
tagname = "tableStyleElement"
type = Set(values=(['wholeTable', 'headerRow', 'totalRow', 'firstColumn',
'lastColumn', 'firstRowStripe', 'secondRowStripe', 'firstColumnStripe',
'secondColumnStripe', 'firstHeaderCell', 'lastHeaderCell',
'firstTotalCell', 'lastTotalCell', 'firstSubtotalColumn',
'secondSubtotalColumn', 'thirdSubtotalColumn', 'firstSubtotalRow',
'secondSubtotalRow', 'thirdSubtotalRow', 'blankRow',
'firstColumnSubheading', 'secondColumnSubheading',
'thirdColumnSubheading', 'firstRowSubheading', 'secondRowSubheading',
'thirdRowSubheading', 'pageFieldLabels', 'pageFieldValues']))
size = Integer(allow_none=True)
dxfId = Integer(allow_none=True)
def __init__(self,
type=None,
size=None,
dxfId=None,
):
self.type = type
self.size = size
self.dxfId = dxfId
class TableStyle(Serialisable):
tagname = "tableStyle"
name = String()
pivot = Bool(allow_none=True)
table = Bool(allow_none=True)
count = Integer(allow_none=True)
tableStyleElement = Typed(expected_type=TableStyleElement, allow_none=True)
__elements__ = ('tableStyleElement',)
def __init__(self,
name=None,
pivot=None,
table=None,
count=None,
tableStyleElement=None,
):
self.name = name
self.pivot = pivot
self.table = table
self.count = count
self.tableStyleElement = tableStyleElement
class TableStyleList(Serialisable):
tagname = "tableStyles"
defaultTableStyle = String(allow_none=True)
defaultPivotStyle = String(allow_none=True)
tableStyle = Sequence(expected_type=TableStyle, allow_none=True)
__elements__ = ('tableStyle',)
__attrs__ = ("count", "defaultTableStyle", "defaultPivotStyle")
def __init__(self,
count=None,
defaultTableStyle="TableStyleMedium9",
defaultPivotStyle="PivotStyleLight16",
tableStyle=(),
):
self.defaultTableStyle = defaultTableStyle
self.defaultPivotStyle = defaultPivotStyle
self.tableStyle = tableStyle
@property
def count(self):
return len(self.tableStyle)
|