MCPcopy Index your code
hub / github.com/python-openxml/python-docx / TabStop

Class TabStop

src/docx/text/tabstops.py:72–123  ·  view source on GitHub ↗

An individual tab stop applying to a paragraph or style. Accessed using list semantics on its containing |TabStops| object.

Source from the content-addressed store, hash-verified

70
71
72class TabStop(ElementProxy):
73 """An individual tab stop applying to a paragraph or style.
74
75 Accessed using list semantics on its containing |TabStops| object.
76 """
77
78 def __init__(self, element):
79 super(TabStop, self).__init__(element, None)
80 self._tab = element
81
82 @property
83 def alignment(self):
84 """A member of :ref:`WdTabAlignment` specifying the alignment setting for this
85 tab stop.
86
87 Read/write.
88 """
89 return self._tab.val
90
91 @alignment.setter
92 def alignment(self, value):
93 self._tab.val = value
94
95 @property
96 def leader(self):
97 """A member of :ref:`WdTabLeader` specifying a repeating character used as a
98 "leader", filling in the space spanned by this tab.
99
100 Assigning |None| produces the same result as assigning `WD_TAB_LEADER.SPACES`.
101 Read/write.
102 """
103 return self._tab.leader
104
105 @leader.setter
106 def leader(self, value):
107 self._tab.leader = value
108
109 @property
110 def position(self):
111 """A |Length| object representing the distance of this tab stop from the inside
112 edge of the paragraph.
113
114 May be positive or negative. Read/write.
115 """
116 return self._tab.pos
117
118 @position.setter
119 def position(self, value):
120 tab = self._tab
121 tabs = tab.getparent()
122 self._tab = tabs.insert_tab_in_order(value, tab.val, tab.leader)
123 tabs.remove(tab)

Callers 9

alignment_get_fixtureMethod · 0.90
alignment_set_fixtureMethod · 0.90
leader_get_fixtureMethod · 0.90
leader_set_fixtureMethod · 0.90
position_get_fixtureMethod · 0.90
position_set_fixtureMethod · 0.90
__getitem__Method · 0.85
__iter__Method · 0.85
add_tab_stopMethod · 0.85

Calls

no outgoing calls

Tested by 6

alignment_get_fixtureMethod · 0.72
alignment_set_fixtureMethod · 0.72
leader_get_fixtureMethod · 0.72
leader_set_fixtureMethod · 0.72
position_get_fixtureMethod · 0.72
position_set_fixtureMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…