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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
|
%global _empty_manifest_terminate_build 0
Name: python-vsdx
Version: 0.5.13
Release: 1
Summary: vsdx - A python library for processing .vsdx files
License: BSD License
URL: https://github.com/dave-howard/vsdx
Source0: https://mirrors.aliyun.com/pypi/web/packages/74/5e/99d0d52481040852bd252925f768b00177753257a14676c52d7b45dd38ca/vsdx-0.5.13.tar.gz
BuildArch: noarch
Requires: python3-Jinja2
Requires: python3-deprecation
%description
### Change Log
- v0.5.13: Update DataProperty class to get value of a property from V attrib or text
- v0.5.12: Add `Shape.fill_color` and `Shape.text_color` properties with get and set tests
- v0.5.11: Add `Shape.find_shapes_by_regex()` & `Page.find_shapes_by_regex()` - add check in `save_vsdx()` that file is open with more meaningful `VisioFileNotOpen` error
- v0.5.10: Add Shape.angle property
- v0.5.9: Add tests for master shape text property
- v0.5.8: Add `Page.master_base_id` property
- v0.5.7: Add support for nested shapes in `Page.all_shapes` and `Shape.all_shapes`. Add `Page.is_master_page` and `Shape.is_master_shape`.
- v0.5.6: Fix error in `Shape.text` with missing master shape. Improve `VisioFile.remove_page_by_index()` and add `VisioFile.remove_page_by_name()`.
- v0.5.5: Added Shape.universal_name and used in Shape.set_start_and_finish(). Set Page.page_id on open file.
- v0.5.4: Added better (but still incomplete) support for adding connectors between shapes
- v0.5.3: Fixed missing deprecation dependency in setup.py
- v0.5.2: deprecated Page.set_name() method and page.page_name property, in favour of Page.name. Unskipped test: test_shape_center(). Added find_shape.rst doc page
- v0.5.1: added Page/Shape.find_shape_by_property_label_value()/find_shapes_by_property_label_value()
- v0.5.0: deprecated Page.shapes property Page/Shape.sub_shapes() methods in favour of Page/Shape.child_shapes property. Add Shape.all_shapes property, convert Page.all_shapes() method to property
- v0.4.20: Shape.set_cell_value()/set_cell_formula() create new cell if missing, add Media().rectangle and circle props, add Shape.bounds, relative_bounds, and end_arrow props
- v0.4.19: correctly position new connector shapes between 'from' and 'to' shapes
- v0.4.18: add page.page_name, width and height properties
- v0.4.17: register xml namespaces to improve compatibility of xml output
- v0.4.16: Add Geometry class to read Shape geometry
- v0.4.15: Add requirement for Jinja2 to package
- v0.4.14: Include media/*.vsdx files in package
- v0.4.13: Fix for master shape property inheritance / value overrides
- v0.4.12: Add support for absolute paths
- v0.4.11: Add support for master shape data properties, with related tests
- v0.4.10: Add methods (`Shape.find_shape_by_property_label()` and `Shape.find_shapes_by_property_label`) to find shape or shapes by data property name.
- v0.4.9: Add support for creating new connection between two objects. Fix ShapeProperty.value, and add label, sort_key, value_type and prompt
- v0.4.8: Support nested loops/showifs and combo of loop and if in same shape.
- v0.4.7: Python 3.10.0rc1 added to test suite. Add `Shape.data_properties` property, and new class `ShapeProperty` to represent Visio Shape Data
- v0.4.6: Add support for nested jinja loops in one shape
- v0.4.5: Fix bug where some shapes have no parent, and inserting shape into empty page
- v0.4.4: Added support for master page shape inheritance, ability to get `Shape.master_shape`, ability to
update master shapes and persist changes to master shapes in `save_vsdx()`
- v0.4.3: Added support for including/excluding pages via Jinja with `{% showif <statement> %}` in page name
- v0.4.2: Added `VisioFile.add_page_at()` method taking `index` to allow insertion
at a specific point; Added `VisionFile.copy_page()` method to copy an existing page
and insert at a specific index or relative to copied page (using `PagePosition` enum).
- v0.4.1: Added support for self referencing calculations in Jinja statements,
such as `{% set self.x = self x + n * 3.2 %}`
- v0.4.0: Added `VisioFile.jinja_set_selfs` to allow setting shape x and
y properties in Jinja template. Setting values, calculations, or if
statements are supported e.g. `{% set self.x = 1.5 %}` or `{% set
self.y = n * 3 %}` or `{% set self.x = 1.0 if n else 2.0 %}`
- v0.3.5: Added `VisioFile.add_page()` method and tests
- v0.3.4: Added `VisioFile.remove_page_by_index()` method to remove a
page, with associated test
- v0.3.3: Added code of conduct and contributing guides
- v0.3.2: updated README and updated tests for improved compatibility
- v0.3.1: add jinja rendering support for if statements, via
`VisioFile.jinja_render_vsdx()` - similar to for loops but using a `{%
showif statement %}` in text of group shape controls whether that
group shape is included in vsdx file rendered. Note that the showif
statement is replaced with a standard if statement around the group
shape prior to rendering. Refer to test.py::test_jinja_if() for an
example
- v0.3.0: update jinja rendering to support for loops, where for
statement is at start of group shape text, endfor is automatically
inserted before processing. Refer to test.py::test_basic_jinja_loop()
for code and test_jinja_loop.vsdx for content.
- v0.2.10: add `VisioFile.jinja_render_vsdx()` - applying jinja
processing to Shape.text only
- v0.2.9: check that Page has shapes tag when in shape_copy(), add test
to copy shape to new page
- v0.2.8: find max shape ID in Page before creating Shape in
`Shape.copy()`. Find and load master pages when file is opened, store
in VisioFile.master_page_objects and .master_pages
- v0.2.7: add `Shape.copy()` method
- v0.2.6: added `Page.get_connectors_between()` to get zero or many
connectors between two shapes, by shape id or text
- 0.2.5: Add new Shape properties connected_shapes (list of Shape
objects) and connects (list of Connect objects) properties to allow
related shapes to be identified (i.e. shapes and connectors) and
provide information on the relationship, in new Connect object. Also
new properties of shape begin_x/y, end_x/y, plus height/width
setters
- 0.2.4: Added find_replace(old, new) method to Shape and Page classes
to recursively replace old with new
- 0.2.3: Updated tests to output files to an /out folder. Added test
vsdx file with compound shape. Updated Shape text getter/setter
- 0.2.2: Added x & y location setters to Shape, and move(x_delta,
y_delta) method - both with related tests
%package -n python3-vsdx
Summary: vsdx - A python library for processing .vsdx files
Provides: python-vsdx
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-vsdx
### Change Log
- v0.5.13: Update DataProperty class to get value of a property from V attrib or text
- v0.5.12: Add `Shape.fill_color` and `Shape.text_color` properties with get and set tests
- v0.5.11: Add `Shape.find_shapes_by_regex()` & `Page.find_shapes_by_regex()` - add check in `save_vsdx()` that file is open with more meaningful `VisioFileNotOpen` error
- v0.5.10: Add Shape.angle property
- v0.5.9: Add tests for master shape text property
- v0.5.8: Add `Page.master_base_id` property
- v0.5.7: Add support for nested shapes in `Page.all_shapes` and `Shape.all_shapes`. Add `Page.is_master_page` and `Shape.is_master_shape`.
- v0.5.6: Fix error in `Shape.text` with missing master shape. Improve `VisioFile.remove_page_by_index()` and add `VisioFile.remove_page_by_name()`.
- v0.5.5: Added Shape.universal_name and used in Shape.set_start_and_finish(). Set Page.page_id on open file.
- v0.5.4: Added better (but still incomplete) support for adding connectors between shapes
- v0.5.3: Fixed missing deprecation dependency in setup.py
- v0.5.2: deprecated Page.set_name() method and page.page_name property, in favour of Page.name. Unskipped test: test_shape_center(). Added find_shape.rst doc page
- v0.5.1: added Page/Shape.find_shape_by_property_label_value()/find_shapes_by_property_label_value()
- v0.5.0: deprecated Page.shapes property Page/Shape.sub_shapes() methods in favour of Page/Shape.child_shapes property. Add Shape.all_shapes property, convert Page.all_shapes() method to property
- v0.4.20: Shape.set_cell_value()/set_cell_formula() create new cell if missing, add Media().rectangle and circle props, add Shape.bounds, relative_bounds, and end_arrow props
- v0.4.19: correctly position new connector shapes between 'from' and 'to' shapes
- v0.4.18: add page.page_name, width and height properties
- v0.4.17: register xml namespaces to improve compatibility of xml output
- v0.4.16: Add Geometry class to read Shape geometry
- v0.4.15: Add requirement for Jinja2 to package
- v0.4.14: Include media/*.vsdx files in package
- v0.4.13: Fix for master shape property inheritance / value overrides
- v0.4.12: Add support for absolute paths
- v0.4.11: Add support for master shape data properties, with related tests
- v0.4.10: Add methods (`Shape.find_shape_by_property_label()` and `Shape.find_shapes_by_property_label`) to find shape or shapes by data property name.
- v0.4.9: Add support for creating new connection between two objects. Fix ShapeProperty.value, and add label, sort_key, value_type and prompt
- v0.4.8: Support nested loops/showifs and combo of loop and if in same shape.
- v0.4.7: Python 3.10.0rc1 added to test suite. Add `Shape.data_properties` property, and new class `ShapeProperty` to represent Visio Shape Data
- v0.4.6: Add support for nested jinja loops in one shape
- v0.4.5: Fix bug where some shapes have no parent, and inserting shape into empty page
- v0.4.4: Added support for master page shape inheritance, ability to get `Shape.master_shape`, ability to
update master shapes and persist changes to master shapes in `save_vsdx()`
- v0.4.3: Added support for including/excluding pages via Jinja with `{% showif <statement> %}` in page name
- v0.4.2: Added `VisioFile.add_page_at()` method taking `index` to allow insertion
at a specific point; Added `VisionFile.copy_page()` method to copy an existing page
and insert at a specific index or relative to copied page (using `PagePosition` enum).
- v0.4.1: Added support for self referencing calculations in Jinja statements,
such as `{% set self.x = self x + n * 3.2 %}`
- v0.4.0: Added `VisioFile.jinja_set_selfs` to allow setting shape x and
y properties in Jinja template. Setting values, calculations, or if
statements are supported e.g. `{% set self.x = 1.5 %}` or `{% set
self.y = n * 3 %}` or `{% set self.x = 1.0 if n else 2.0 %}`
- v0.3.5: Added `VisioFile.add_page()` method and tests
- v0.3.4: Added `VisioFile.remove_page_by_index()` method to remove a
page, with associated test
- v0.3.3: Added code of conduct and contributing guides
- v0.3.2: updated README and updated tests for improved compatibility
- v0.3.1: add jinja rendering support for if statements, via
`VisioFile.jinja_render_vsdx()` - similar to for loops but using a `{%
showif statement %}` in text of group shape controls whether that
group shape is included in vsdx file rendered. Note that the showif
statement is replaced with a standard if statement around the group
shape prior to rendering. Refer to test.py::test_jinja_if() for an
example
- v0.3.0: update jinja rendering to support for loops, where for
statement is at start of group shape text, endfor is automatically
inserted before processing. Refer to test.py::test_basic_jinja_loop()
for code and test_jinja_loop.vsdx for content.
- v0.2.10: add `VisioFile.jinja_render_vsdx()` - applying jinja
processing to Shape.text only
- v0.2.9: check that Page has shapes tag when in shape_copy(), add test
to copy shape to new page
- v0.2.8: find max shape ID in Page before creating Shape in
`Shape.copy()`. Find and load master pages when file is opened, store
in VisioFile.master_page_objects and .master_pages
- v0.2.7: add `Shape.copy()` method
- v0.2.6: added `Page.get_connectors_between()` to get zero or many
connectors between two shapes, by shape id or text
- 0.2.5: Add new Shape properties connected_shapes (list of Shape
objects) and connects (list of Connect objects) properties to allow
related shapes to be identified (i.e. shapes and connectors) and
provide information on the relationship, in new Connect object. Also
new properties of shape begin_x/y, end_x/y, plus height/width
setters
- 0.2.4: Added find_replace(old, new) method to Shape and Page classes
to recursively replace old with new
- 0.2.3: Updated tests to output files to an /out folder. Added test
vsdx file with compound shape. Updated Shape text getter/setter
- 0.2.2: Added x & y location setters to Shape, and move(x_delta,
y_delta) method - both with related tests
%package help
Summary: Development documents and examples for vsdx
Provides: python3-vsdx-doc
%description help
### Change Log
- v0.5.13: Update DataProperty class to get value of a property from V attrib or text
- v0.5.12: Add `Shape.fill_color` and `Shape.text_color` properties with get and set tests
- v0.5.11: Add `Shape.find_shapes_by_regex()` & `Page.find_shapes_by_regex()` - add check in `save_vsdx()` that file is open with more meaningful `VisioFileNotOpen` error
- v0.5.10: Add Shape.angle property
- v0.5.9: Add tests for master shape text property
- v0.5.8: Add `Page.master_base_id` property
- v0.5.7: Add support for nested shapes in `Page.all_shapes` and `Shape.all_shapes`. Add `Page.is_master_page` and `Shape.is_master_shape`.
- v0.5.6: Fix error in `Shape.text` with missing master shape. Improve `VisioFile.remove_page_by_index()` and add `VisioFile.remove_page_by_name()`.
- v0.5.5: Added Shape.universal_name and used in Shape.set_start_and_finish(). Set Page.page_id on open file.
- v0.5.4: Added better (but still incomplete) support for adding connectors between shapes
- v0.5.3: Fixed missing deprecation dependency in setup.py
- v0.5.2: deprecated Page.set_name() method and page.page_name property, in favour of Page.name. Unskipped test: test_shape_center(). Added find_shape.rst doc page
- v0.5.1: added Page/Shape.find_shape_by_property_label_value()/find_shapes_by_property_label_value()
- v0.5.0: deprecated Page.shapes property Page/Shape.sub_shapes() methods in favour of Page/Shape.child_shapes property. Add Shape.all_shapes property, convert Page.all_shapes() method to property
- v0.4.20: Shape.set_cell_value()/set_cell_formula() create new cell if missing, add Media().rectangle and circle props, add Shape.bounds, relative_bounds, and end_arrow props
- v0.4.19: correctly position new connector shapes between 'from' and 'to' shapes
- v0.4.18: add page.page_name, width and height properties
- v0.4.17: register xml namespaces to improve compatibility of xml output
- v0.4.16: Add Geometry class to read Shape geometry
- v0.4.15: Add requirement for Jinja2 to package
- v0.4.14: Include media/*.vsdx files in package
- v0.4.13: Fix for master shape property inheritance / value overrides
- v0.4.12: Add support for absolute paths
- v0.4.11: Add support for master shape data properties, with related tests
- v0.4.10: Add methods (`Shape.find_shape_by_property_label()` and `Shape.find_shapes_by_property_label`) to find shape or shapes by data property name.
- v0.4.9: Add support for creating new connection between two objects. Fix ShapeProperty.value, and add label, sort_key, value_type and prompt
- v0.4.8: Support nested loops/showifs and combo of loop and if in same shape.
- v0.4.7: Python 3.10.0rc1 added to test suite. Add `Shape.data_properties` property, and new class `ShapeProperty` to represent Visio Shape Data
- v0.4.6: Add support for nested jinja loops in one shape
- v0.4.5: Fix bug where some shapes have no parent, and inserting shape into empty page
- v0.4.4: Added support for master page shape inheritance, ability to get `Shape.master_shape`, ability to
update master shapes and persist changes to master shapes in `save_vsdx()`
- v0.4.3: Added support for including/excluding pages via Jinja with `{% showif <statement> %}` in page name
- v0.4.2: Added `VisioFile.add_page_at()` method taking `index` to allow insertion
at a specific point; Added `VisionFile.copy_page()` method to copy an existing page
and insert at a specific index or relative to copied page (using `PagePosition` enum).
- v0.4.1: Added support for self referencing calculations in Jinja statements,
such as `{% set self.x = self x + n * 3.2 %}`
- v0.4.0: Added `VisioFile.jinja_set_selfs` to allow setting shape x and
y properties in Jinja template. Setting values, calculations, or if
statements are supported e.g. `{% set self.x = 1.5 %}` or `{% set
self.y = n * 3 %}` or `{% set self.x = 1.0 if n else 2.0 %}`
- v0.3.5: Added `VisioFile.add_page()` method and tests
- v0.3.4: Added `VisioFile.remove_page_by_index()` method to remove a
page, with associated test
- v0.3.3: Added code of conduct and contributing guides
- v0.3.2: updated README and updated tests for improved compatibility
- v0.3.1: add jinja rendering support for if statements, via
`VisioFile.jinja_render_vsdx()` - similar to for loops but using a `{%
showif statement %}` in text of group shape controls whether that
group shape is included in vsdx file rendered. Note that the showif
statement is replaced with a standard if statement around the group
shape prior to rendering. Refer to test.py::test_jinja_if() for an
example
- v0.3.0: update jinja rendering to support for loops, where for
statement is at start of group shape text, endfor is automatically
inserted before processing. Refer to test.py::test_basic_jinja_loop()
for code and test_jinja_loop.vsdx for content.
- v0.2.10: add `VisioFile.jinja_render_vsdx()` - applying jinja
processing to Shape.text only
- v0.2.9: check that Page has shapes tag when in shape_copy(), add test
to copy shape to new page
- v0.2.8: find max shape ID in Page before creating Shape in
`Shape.copy()`. Find and load master pages when file is opened, store
in VisioFile.master_page_objects and .master_pages
- v0.2.7: add `Shape.copy()` method
- v0.2.6: added `Page.get_connectors_between()` to get zero or many
connectors between two shapes, by shape id or text
- 0.2.5: Add new Shape properties connected_shapes (list of Shape
objects) and connects (list of Connect objects) properties to allow
related shapes to be identified (i.e. shapes and connectors) and
provide information on the relationship, in new Connect object. Also
new properties of shape begin_x/y, end_x/y, plus height/width
setters
- 0.2.4: Added find_replace(old, new) method to Shape and Page classes
to recursively replace old with new
- 0.2.3: Updated tests to output files to an /out folder. Added test
vsdx file with compound shape. Updated Shape text getter/setter
- 0.2.2: Added x & y location setters to Shape, and move(x_delta,
y_delta) method - both with related tests
%prep
%autosetup -n vsdx-0.5.13
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-vsdx -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Thu Jun 08 2023 Python_Bot <Python_Bot@openeuler.org> - 0.5.13-1
- Package Spec generated
|