Skip to content

Commit 01b86e6

Browse files
committed
rfctr(enum): modernize enumerations
1 parent 7efa08d commit 01b86e6

File tree

18 files changed

+2785
-2556
lines changed

18 files changed

+2785
-2556
lines changed

src/pptx/enum/action.py

Lines changed: 55 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
# encoding: utf-8
1+
"""Enumerations that describe click-action settings."""
22

3-
"""
4-
Enumerations that describe click action settings
5-
"""
3+
from __future__ import annotations
64

7-
from __future__ import absolute_import
5+
from pptx.enum.base import BaseEnum
86

9-
from .base import alias, Enumeration, EnumMember
107

11-
12-
@alias("PP_ACTION")
13-
class PP_ACTION_TYPE(Enumeration):
8+
class PP_ACTION_TYPE(BaseEnum):
149
"""
1510
Specifies the type of a mouse action (click or hover action).
1611
@@ -21,26 +16,56 @@ class PP_ACTION_TYPE(Enumeration):
2116
from pptx.enum.action import PP_ACTION
2217
2318
assert shape.click_action.action == PP_ACTION.HYPERLINK
19+
20+
MS API name: `PpActionType`
21+
22+
https://msdn.microsoft.com/EN-US/library/office/ff744895.aspx
2423
"""
2524

26-
__ms_name__ = "PpActionType"
27-
28-
__url__ = "https://msdn.microsoft.com/EN-US/library/office/ff744895.aspx"
29-
30-
__members__ = (
31-
EnumMember("END_SHOW", 6, "Slide show ends."),
32-
EnumMember("FIRST_SLIDE", 3, "Returns to the first slide."),
33-
EnumMember("HYPERLINK", 7, "Hyperlink."),
34-
EnumMember("LAST_SLIDE", 4, "Moves to the last slide."),
35-
EnumMember("LAST_SLIDE_VIEWED", 5, "Moves to the last slide viewed."),
36-
EnumMember("NAMED_SLIDE", 101, "Moves to slide specified by slide number."),
37-
EnumMember("NAMED_SLIDE_SHOW", 10, "Runs the slideshow."),
38-
EnumMember("NEXT_SLIDE", 1, "Moves to the next slide."),
39-
EnumMember("NONE", 0, "No action is performed."),
40-
EnumMember("OPEN_FILE", 102, "Opens the specified file."),
41-
EnumMember("OLE_VERB", 11, "OLE Verb."),
42-
EnumMember("PLAY", 12, "Begins the slideshow."),
43-
EnumMember("PREVIOUS_SLIDE", 2, "Moves to the previous slide."),
44-
EnumMember("RUN_MACRO", 8, "Runs a macro."),
45-
EnumMember("RUN_PROGRAM", 9, "Runs a program."),
46-
)
25+
END_SHOW = (6, "Slide show ends.")
26+
"""Slide show ends."""
27+
28+
FIRST_SLIDE = (3, "Returns to the first slide.")
29+
"""Returns to the first slide."""
30+
31+
HYPERLINK = (7, "Hyperlink.")
32+
"""Hyperlink."""
33+
34+
LAST_SLIDE = (4, "Moves to the last slide.")
35+
"""Moves to the last slide."""
36+
37+
LAST_SLIDE_VIEWED = (5, "Moves to the last slide viewed.")
38+
"""Moves to the last slide viewed."""
39+
40+
NAMED_SLIDE = (101, "Moves to slide specified by slide number.")
41+
"""Moves to slide specified by slide number."""
42+
43+
NAMED_SLIDE_SHOW = (10, "Runs the slideshow.")
44+
"""Runs the slideshow."""
45+
46+
NEXT_SLIDE = (1, "Moves to the next slide.")
47+
"""Moves to the next slide."""
48+
49+
NONE = (0, "No action is performed.")
50+
"""No action is performed."""
51+
52+
OPEN_FILE = (102, "Opens the specified file.")
53+
"""Opens the specified file."""
54+
55+
OLE_VERB = (11, "OLE Verb.")
56+
"""OLE Verb."""
57+
58+
PLAY = (12, "Begins the slideshow.")
59+
"""Begins the slideshow."""
60+
61+
PREVIOUS_SLIDE = (2, "Moves to the previous slide.")
62+
"""Moves to the previous slide."""
63+
64+
RUN_MACRO = (8, "Runs a macro.")
65+
"""Runs a macro."""
66+
67+
RUN_PROGRAM = (9, "Runs a program.")
68+
"""Runs a program."""
69+
70+
71+
PP_ACTION = PP_ACTION_TYPE

0 commit comments

Comments
 (0)