/usr/lib/python2.7/dist-packages/openpyxl/worksheet/pagebreak.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 | from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Integer,
Bool,
Sequence,
)
class Break(Serialisable):
tagname = "brk"
id = Integer(allow_none=True)
min = Integer(allow_none=True)
max = Integer(allow_none=True)
man = Bool(allow_none=True)
pt = Bool(allow_none=True)
def __init__(self,
id=0,
min=0,
max=16383,
man=True,
pt=None,
):
self.id = id
self.min = min
self.max = max
self.man = man
self.pt = pt
class PageBreak(Serialisable):
tagname = "rowBreaks"
count = Integer(allow_none=True)
manualBreakCount = Integer(allow_none=True)
brk = Sequence(expected_type=Break, allow_none=True)
__elements__ = ('brk',)
def __init__(self,
count=None,
manualBreakCount=None,
brk=[],
):
self.brk = brk
self.__attrs__ = ("count", "manualBreakCount",)
def __len__(self):
return len(self.brk)
@property
def count(self):
return len(self)
@property
def manualBreakCount(self):
return len(self)
def append(self, brk=None):
"""
Add a page break
"""
vals = list(self.brk)
if not isinstance(brk, Break):
brk = Break(id=self.count+1)
vals.append(brk)
self.brk = vals
|