/usr/lib/python2.7/dist-packages/openpyxl/styles/__init__.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 | from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
from openpyxl.descriptors import Typed
from openpyxl.compat import deprecated
from .alignment import Alignment
from .borders import Border, Side
from .colors import Color
from .fills import PatternFill, GradientFill, Fill
from .fonts import Font
from .hashable import HashableObject
from .numbers import NumberFormatDescriptor, is_date_format, is_builtin
from .protection import Protection
from .proxy import StyleProxy
class Style(HashableObject):
"""Style object containing all formatting details."""
__fields__ = ('font',
'fill',
'border',
'alignment',
'number_format',
'protection')
__base__ = True
font = Typed(expected_type=Font)
fill = Typed(expected_type=Fill, allow_none=True)
border = Typed(expected_type=Border)
alignment = Typed(expected_type=Alignment)
number_format = NumberFormatDescriptor()
protection = Typed(expected_type=Protection)
def __init__(self,
font=Font(),
fill=PatternFill(),
border=Border(),
alignment=Alignment(),
number_format=None,
protection=Protection()
):
self.font = font
self.fill = fill
self.border = border
self.alignment = alignment
self.number_format = number_format
self.protection = protection
@deprecated("Copy formatting objects like font directly")
def copy(self):
cls = self.__class__
return cls(font=self.font.copy(),
fill=self.fill.copy(),
border=self.border.copy(),
alignment=self.alignment.copy(),
number_format=self.number_format,
protection=self.protection.copy()
)
DEFAULTS = Style()
|