Coverage for /var/srv/projects/api.amasfac.comuna18.com/tmp/venv/lib/python3.9/site-packages/openpyxl/drawing/connector.py: 73%
74 statements
« prev ^ index » next coverage.py v6.4.4, created at 2023-07-17 14:22 -0600
« prev ^ index » next coverage.py v6.4.4, created at 2023-07-17 14:22 -0600
1# Copyright (c) 2010-2022 openpyxl
3from openpyxl.descriptors.serialisable import Serialisable
4from openpyxl.descriptors import (
5 Typed,
6 Bool,
7 Integer,
8 String,
9 Alias,
10)
11from openpyxl.descriptors.excel import ExtensionList as OfficeArtExtensionList
12from openpyxl.chart.shapes import GraphicalProperties
13from openpyxl.chart.text import RichText
15from .properties import (
16 NonVisualDrawingProps,
17 NonVisualDrawingShapeProps,
18)
19from .geometry import ShapeStyle
21class Connection(Serialisable):
23 id = Integer()
24 idx = Integer()
26 def __init__(self,
27 id=None,
28 idx=None,
29 ):
30 self.id = id
31 self.idx = idx
34class ConnectorLocking(Serialisable):
36 extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True)
38 def __init__(self,
39 extLst=None,
40 ):
41 self.extLst = extLst
44class NonVisualConnectorProperties(Serialisable):
46 cxnSpLocks = Typed(expected_type=ConnectorLocking, allow_none=True)
47 stCxn = Typed(expected_type=Connection, allow_none=True)
48 endCxn = Typed(expected_type=Connection, allow_none=True)
49 extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True)
51 def __init__(self,
52 cxnSpLocks=None,
53 stCxn=None,
54 endCxn=None,
55 extLst=None,
56 ):
57 self.cxnSpLocks = cxnSpLocks
58 self.stCxn = stCxn
59 self.endCxn = endCxn
60 self.extLst = extLst
63class ConnectorNonVisual(Serialisable):
65 cNvPr = Typed(expected_type=NonVisualDrawingProps, )
66 cNvCxnSpPr = Typed(expected_type=NonVisualConnectorProperties, )
68 __elements__ = ("cNvPr", "cNvCxnSpPr",)
70 def __init__(self,
71 cNvPr=None,
72 cNvCxnSpPr=None,
73 ):
74 self.cNvPr = cNvPr
75 self.cNvCxnSpPr = cNvCxnSpPr
78class ConnectorShape(Serialisable):
80 tagname = "cxnSp"
82 nvCxnSpPr = Typed(expected_type=ConnectorNonVisual)
83 spPr = Typed(expected_type=GraphicalProperties)
84 style = Typed(expected_type=ShapeStyle, allow_none=True)
85 macro = String(allow_none=True)
86 fPublished = Bool(allow_none=True)
88 def __init__(self,
89 nvCxnSpPr=None,
90 spPr=None,
91 style=None,
92 macro=None,
93 fPublished=None,
94 ):
95 self.nvCxnSpPr = nvCxnSpPr
96 self.spPr = spPr
97 self.style = style
98 self.macro = macro
99 self.fPublished = fPublished
102class ShapeMeta(Serialisable):
104 tagname = "nvSpPr"
106 cNvPr = Typed(expected_type=NonVisualDrawingProps)
107 cNvSpPr = Typed(expected_type=NonVisualDrawingShapeProps)
109 def __init__(self, cNvPr=None, cNvSpPr=None):
110 self.cNvPr = cNvPr
111 self.cNvSpPr = cNvSpPr
114class Shape(Serialisable):
116 macro = String(allow_none=True)
117 textlink = String(allow_none=True)
118 fPublished = Bool(allow_none=True)
119 fLocksText = Bool(allow_none=True)
120 nvSpPr = Typed(expected_type=ShapeMeta, allow_none=True)
121 meta = Alias("nvSpPr")
122 spPr = Typed(expected_type=GraphicalProperties)
123 graphicalProperties = Alias("spPr")
124 style = Typed(expected_type=ShapeStyle, allow_none=True)
125 txBody = Typed(expected_type=RichText, allow_none=True)
127 def __init__(self,
128 macro=None,
129 textlink=None,
130 fPublished=None,
131 fLocksText=None,
132 nvSpPr=None,
133 spPr=None,
134 style=None,
135 txBody=None,
136 ):
137 self.macro = macro
138 self.textlink = textlink
139 self.fPublished = fPublished
140 self.fLocksText = fLocksText
141 self.nvSpPr = nvSpPr
142 self.spPr = spPr
143 self.style = style
144 self.txBody = txBody