/usr/lib/python2.7/dist-packages/openpyxl/worksheet/hyperlink.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 | from __future__ import absolute_import
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
String,
Sequence,
)
from openpyxl.descriptors.excel import Relation
class Hyperlink(Serialisable):
tagname = "hyperlink"
ref = String()
location = String(allow_none=True)
tooltip = String(allow_none=True)
display = String(allow_none=True)
id = Relation()
target = String(allow_none=True)
__attrs__ = ("ref", "location", "tooltip", "display", "id")
def __init__(self,
ref=None,
location=None,
tooltip=None,
display=None,
id=None,
target=None,
):
self.ref = ref
self.location = location
self.tooltip = tooltip
self.display = display
self.id = id
self.target = target
class HyperlinkList(Serialisable):
tagname = "hyperlinks"
hyperlink = Sequence(expected_type=Hyperlink)
def __init__(self, hyperlink=()):
self.hyperlink = hyperlink
def __bool__(self):
return bool(self.hyperlink)
__nonzero__ = __bool__
def __len__(self):
return len(self.hyperlink)
def append(self, value):
values = self.hyperlink[:]
values.append(value)
if not value.id:
value.id = "rId{0}".format(len(values))
self.hyperlink = values
|