/usr/lib/python2.7/dist-packages/openpyxl/worksheet/views.py is in python-openpyxl 2.3.0-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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
from openpyxl.descriptors import Bool, Integer, String, Set, Float, Typed, NoneSet, Sequence
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.compat import safe_string
class Pane(Serialisable):
xSplit = Float(allow_none=True)
ySplit = Float(allow_none=True)
topLeftCell = String(allow_none=True)
activePane = Set(values=("bottomRight", "topRight", "bottomLeft", "topLeft"))
state = Set(values=("split", "frozen", "frozenSplit"))
def __init__(self,
xSplit=None,
ySplit=None,
topLeftCell=None,
activePane="topLeft",
state="split"):
self.xSplit = xSplit
self.ySplit = ySplit
self.topLeftCell = topLeftCell
self.activePane = activePane
self.state = state
class Selection(Serialisable):
pane = NoneSet(values=("bottomRight", "topRight", "bottomLeft", "topLeft"))
activeCell = String(allow_none=True)
activeCellId = Integer(allow_none=True)
sqref = String(allow_none=True)
def __init__(self,
pane=None,
activeCell="A1",
activeCellId=None,
sqref="A1"):
self.pane = pane
self.activeCell = activeCell
self.activeCellId = activeCellId
self.sqref = sqref
class SheetView(Serialisable):
"""Information about the visible portions of this sheet."""
tagname = "sheetView"
windowProtection = Bool(allow_none=True)
showFormulas = Bool(allow_none=True)
showGridLines = Bool(allow_none=True)
showRowColHeaders = Bool(allow_none=True)
showZeros = Bool(allow_none=True)
rightToLeft = Bool(allow_none=True)
tabSelected = Bool(allow_none=True)
showRuler = Bool(allow_none=True)
showOutlineSymbols = Bool(allow_none=True)
defaultGridColor = Bool(allow_none=True)
showWhiteSpace = Bool(allow_none=True)
view = NoneSet(values=("normal", "pageBreakPreview", "pageLayout"))
topLeftCell = String(allow_none=True)
colorId = Integer(allow_none=True)
zoomScale = Integer(allow_none=True)
zoomScaleNormal = Integer(allow_none=True)
zoomScaleSheetLayoutView = Integer(allow_none=True)
zoomScalePageLayoutView = Integer(allow_none=True)
workbookViewId = Integer()
selection = Sequence(expected_type=Selection)
pane = Typed(expected_type=Pane, allow_none=True)
def __init__(
self,
windowProtection=None,
showFormulas=None,
showGridLines=True,
showRowColHeaders=None,
showZeros=None,
rightToLeft=None,
tabSelected=None,
showRuler=None,
showOutlineSymbols=None,
defaultGridColor=None,
showWhiteSpace=None,
view=None,
topLeftCell=None,
colorId=None,
zoomScale=None,
zoomScaleNormal=None,
zoomScaleSheetLayoutView=None,
zoomScalePageLayoutView=None,
workbookViewId=0,
selection=None,
pane=None,
):
self.windowProtection = windowProtection
self.showFormulas = showFormulas
self.showGridLines = showGridLines
self.showRowColHeaders = showRowColHeaders
self.showZeros = showZeros
self.rightToLeft = rightToLeft
self.tabSelected = tabSelected
self.showRuler = showRuler
self.showOutlineSymbols = showOutlineSymbols
self.defaultGridColor = defaultGridColor
self.showWhiteSpace = showWhiteSpace
self.view = view
self.topLeftCell = topLeftCell
self.colorId = colorId
self.zoomScale = zoomScale
self.zoomScaleNormal = zoomScaleNormal
self.zoomScaleSheetLayoutView = zoomScaleSheetLayoutView
self.zoomScalePageLayoutView = zoomScalePageLayoutView
self.workbookViewId = workbookViewId
self.pane = pane
if selection is None:
selection = (Selection(), )
self.selection = selection
def __iter__(self):
for attr in self.__attrs__:
value = getattr(self, attr)
if attr == 'showGridLines' and value:
continue
if value is not None:
yield attr, safe_string(value)
|