Skip to content

Commit b26ee9e

Browse files
committed
docs: update API documentation for AxisTitle
Fix any small documentation problems from the issues list while we're in there in preparation for a release.
1 parent bfd6273 commit b26ee9e

9 files changed

Lines changed: 66 additions & 17 deletions

File tree

‎docs/api/chart.rst‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ a category nor a value axis.
7272
:members:
7373
:member-order: bysource
7474

75+
.. autoclass:: pptx.chart.axis.AxisTitle()
76+
:members:
77+
:member-order: bysource
78+
7579

7680
Value Axes
7781
~~~~~~~~~~
@@ -227,10 +231,11 @@ The following properties are available on series objects of all types.
227231
|BarSeries| objects
228232
~~~~~~~~~~~~~~~~~~~
229233

230-
These properties are only available on series belonging to a bar-type plot.
234+
These properties are available on a series belonging to a bar-type plot.
231235

232236
.. autoclass:: pptx.chart.series.BarSeries()
233237
:exclude-members: get_or_add_ln, ln
238+
:inherited-members:
234239
:members:
235240
:member-order: bysource
236241
:undoc-members:
@@ -239,9 +244,10 @@ These properties are only available on series belonging to a bar-type plot.
239244
|LineSeries| objects
240245
~~~~~~~~~~~~~~~~~~~~
241246

242-
These properties are only available on series belonging to a line-type plot.
247+
These properties are available on a series belonging to a line-type plot.
243248

244249
.. autoclass:: pptx.chart.series.LineSeries()
250+
:inherited-members:
245251
:members:
246252
:member-order: bysource
247253
:undoc-members:
@@ -266,6 +272,11 @@ An XY or bubble chart has a :attr:`points` attribute providing access to a
266272
sequence of |Point| objects. That sequence supports iteration, indexed
267273
access, and ``len()``.
268274

275+
.. autoclass:: pptx.chart.point.CategoryPoints()
276+
:members:
277+
:member-order: bysource
278+
:undoc-members:
279+
269280
.. autoclass:: pptx.chart.point.BubblePoints()
270281
:members:
271282
:member-order: bysource

‎docs/api/slides.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The |Slides| object is accessed using the
1111
is not intended to be constructed directly.
1212

1313
.. autoclass:: pptx.slide.Slides()
14-
:members: add_slide
14+
:members:
1515
:member-order: bysource
1616
:undoc-members:
1717

‎docs/conf.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ def _warn_node(self, msg, node):
131131
132132
.. |CategoryLevel| replace:: :class:`.CategoryLevel`
133133
134+
.. |CategoryPoints| replace:: :class:`.CategoryPoints`
135+
134136
.. |_Cell| replace:: :class:`_Cell`
135137
136138
.. |Chart| replace:: :class:`.Chart`

‎docs/user/autoshapes.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ positioned one inch from the top-left corner of the slide::
2020

2121
from pptx.enum.shapes import MSO_SHAPE
2222

23+
shapes = slide.shapes
2324
left = top = width = height = Inches(1.0)
2425
shape = shapes.add_shape(
2526
MSO_SHAPE.ROUNDED_RECTANGLE, left, top, width, height

‎pptx/chart/series.py‎

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from __future__ import absolute_import, print_function, unicode_literals
88

99
from collections import Sequence
10+
from warnings import warn
1011

1112
from ..dml.chtfmt import ChartFormat
1213
from ..dml.fill import FillFormat
@@ -110,10 +111,17 @@ class BarSeries(_BaseCategorySeries):
110111
"""
111112
@lazyproperty
112113
def fill(self):
114+
"""**DEPRECATED**. Use `.format.fill` instead.
115+
116+
Return the |FillFormat| object providing access to fill properties
117+
such as fill color.
113118
"""
114-
|FillFormat| instance for this series, providing access to fill
115-
properties such as fill color.
116-
"""
119+
msg = (
120+
'BarSeries.fill property is deprecated and will be removed in a '
121+
'future release.'
122+
)
123+
warn(msg, UserWarning, stacklevel=2)
124+
117125
spPr = self._element.get_or_add_spPr()
118126
return FillFormat.from_fill_parent(spPr)
119127

@@ -150,10 +158,17 @@ def invert_if_negative(self, value):
150158

151159
@lazyproperty
152160
def line(self):
161+
"""**DEPRECATED**. Use `.format.line` instead.
162+
163+
Return the |LineFormat| object providing access to line properties
164+
such as line color and width.
153165
"""
154-
|LineFormat| instance for this shape, providing access to line
155-
properties such as line color and width.
156-
"""
166+
msg = (
167+
'BarSeries.line property is deprecated and will be removed in a '
168+
'future release.'
169+
)
170+
warn(msg, UserWarning, stacklevel=2)
171+
157172
return LineFormat(self)
158173

159174
@property

‎pptx/chart/xmlwriter.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from copy import deepcopy
1010
from xml.sax.saxutils import escape
1111

12+
from ..compat import to_unicode
1213
from ..enum.chart import XL_CHART_TYPE
1314
from ..oxml import parse_xml
1415
from ..oxml.ns import nsdecls
@@ -1498,7 +1499,7 @@ def _cat_pt_xml(self):
14981499
' </c:pt>\n'
14991500
).format(**{
15001501
'cat_idx': idx,
1501-
'cat_label': escape(str(category.label)),
1502+
'cat_label': escape(to_unicode(category.label)),
15021503
})
15031504
return xml
15041505

‎pptx/enum/base.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ def _intro_text(self):
5858
cls_docstring = self._clsdict['__doc__']
5959
except KeyError:
6060
cls_docstring = ''
61+
62+
if cls_docstring is None:
63+
return ''
64+
6165
return textwrap.dedent(cls_docstring).strip()
6266

6367
def _member_def(self, member):

‎pptx/shapes/base.py‎

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
Base shape-related objects such as BaseShape.
55
"""
66

7-
from __future__ import absolute_import, print_function
7+
from __future__ import (
8+
absolute_import, division, print_function, unicode_literals
9+
)
10+
11+
from warnings import warn
812

913
from ..action import ActionSetting
1014
from ..shared import ElementProxy
@@ -83,11 +87,14 @@ def height(self, value):
8387

8488
@property
8589
def id(self):
86-
"""
87-
Read-only positive integer identifying this shape. The id of a shape
88-
is unique among all shapes on a slide.
89-
"""
90-
return self._element.shape_id
90+
"""**DEPRECATED**. Use `.shape_id` instead."""
91+
msg = (
92+
'BaseShape.shape_id property is deprecated and will be removed i'
93+
'n a future release.'
94+
)
95+
warn(msg, UserWarning, stacklevel=2)
96+
97+
return self.shape_id
9198

9299
@property
93100
def is_placeholder(self):
@@ -152,6 +159,14 @@ def rotation(self):
152159
def rotation(self, value):
153160
self._element.rot = value
154161

162+
@property
163+
def shape_id(self):
164+
"""Read-only positive integer identifying this shape.
165+
166+
The id of a shape is unique among all shapes on a slide.
167+
"""
168+
return self._element.shape_id
169+
155170
@property
156171
def shape_type(self):
157172
"""

‎pptx/text/text.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def fit_text(self, font_family='Calibri', max_size=18, bold=False,
7171
than *max_size* points. If the path to a matching TrueType font is
7272
provided as *font_file*, that font file will be used for the font
7373
metrics. If *font_file* is |None|, best efforts are made to locate
74-
a font file with mathching *font_family*, *bold*, and *italic*
74+
a font file with matchhing *font_family*, *bold*, and *italic*
7575
installed on the current system (usually succeeds if the font is
7676
installed).
7777
"""

0 commit comments

Comments
 (0)