• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

haiiliin / abqpy / 6433593370

06 Oct 2023 03:30PM UTC coverage: 73.825% (-9.3%) from 83.134%
6433593370

push

github

web-flow
[feature] Add GUI Toolkit Commands (backport #5260) (#5285)

[feature] Add GUI Toolkit Commands (#5260)

* Markdown

* Delete

* Add AFXApp and AFXBoolKeyword

* Delete

* Update headings

* Create parse.py

* Update parse.py

* Unicode Spaces

* Update .pre-commit-config.yaml

* Update md types

* Update Kernel plug-in registration commands.md

* Generated python stubs

* Add class inheritance

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Revert "Update .pre-commit-config.yaml"

This reverts commit 9d3aef3cc.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix mypy errors

* Delete parse.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix return types and imports

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update AFXColumnItems.md

* Update abaqusGui.py

* Add class/global flags

* Delete flags.py

* Fix flags

* Fix

* Skip mypy

* Update abaqusGui.py

* Update constants.py

* Create kernelAccess.py

* Add plugin docs

* Revert changes by docformatter

* Delete markdown files

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit a65ff5df8)

Co-authored-by: Hailin Wang <hailin.wang@connect.polyu.hk>

3661 of 3661 new or added lines in 151 files covered. (100.0%)

24137 of 32695 relevant lines covered (73.82%)

0.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/abaqus/PlugInRegistration/AFXTupleKeyword.py
1
from __future__ import annotations
×
2

3
from .AFXCommand import AFXCommand
×
4
from .AFXKeyword import AFXKeyword
×
5

6
#: Any type is accepted.
7
AFXTUPLE_TYPE_ANY: int = hash("AFXTUPLE_TYPE_ANY")
×
8

9
#: Element type is the same as the tuple default type.
10
AFXTUPLE_TYPE_DEFAULT: int = hash("AFXTUPLE_TYPE_DEFAULT")
×
11

12
#: Element is an integer number.
13
AFXTUPLE_TYPE_INT: int = hash("AFXTUPLE_TYPE_INT")
×
14

15
#: Element is a floating-point number.
16
AFXTUPLE_TYPE_FLOAT: int = hash("AFXTUPLE_TYPE_FLOAT")
×
17

18
#: Element is a string.
19
AFXTUPLE_TYPE_STRING: int = hash("AFXTUPLE_TYPE_STRING")
×
20

21
#: Element is True or False.
22
AFXTUPLE_TYPE_BOOL: int = hash("AFXTUPLE_TYPE_BOOL")
×
23

24
#: Mask for element types.
25
AFXTUPLE_TYPE_MASK: int = hash("AFXTUPLE_TYPE_MASK")
×
26

27
#: Allow empty values for the element.
28
AFXTUPLE_ALLOW_EMPTY: int = hash("AFXTUPLE_ALLOW_EMPTY")
×
29

30
#: Always substitute the default for an empty value.
31
AFXTUPLE_DEFAULT_IF_EMPTY: int = hash("AFXTUPLE_DEFAULT_IF_EMPTY")
×
32

33
#: Evaluate integer and float elements.
34
AFXTUPLE_EVALUATE: int = hash("AFXTUPLE_EVALUATE")
×
35

36
#: Use tuple default element style.
37
AFXTUPLE_STYLE_DEFAULT: int = hash("AFXTUPLE_STYLE_DEFAULT")
×
38

39
#: Mask for element styles.
40
AFXTUPLE_STYLE_MASK: int = hash("AFXTUPLE_STYLE_MASK")
×
41

42

43
class AFXTupleKeyword(AFXKeyword):
×
44
    """This class manages values which are sent as tuples in a command."""
45

46
    #: For debugging.
47
    ID_PRINTSNIPPET: int = hash("ID_PRINTSNIPPET")
×
48

49
    def __init__(
×
50
        self,
51
        command: AFXCommand,
52
        name: str,
53
        isRequired: bool = False,
54
        minLength: int = 0,
55
        maxLength: int = -1,
56
        opts: int = 0,
57
    ):
58
        """Constructor.
59

60
        Parameters
61
        ----------
62
        command : AFXCommand
63
            Host command.
64
        name : str
65
            Keyword name.
66
        isRequired : bool
67
            True if this keyword is a required argument.
68
        minLength : int
69
            Minimum (and default) tuple length.
70
        maxLength : int
71
            Maximum tuple length (-1 => unlimited).
72
        opts : int
73
            Options.
74
        """
75

76
    def equal(self, index: int, a: str, b: str):
×
77
        """Returns True if the two tuple element values compare equal (index is not used).
78

79
        Parameters
80
        ----------
81
        index : int
82
            Element index (not used).
83
        a : str
84
            First value.
85
        b : str
86
            Second value.
87
        """
88

89
    def getDefaultStyle(self):
×
90
        """Returns the default style for elements."""
91

92
    def getDefaultType(self):
×
93
        """Returns the default type for elements."""
94

95
    def getDefaultValues(self):
×
96
        """Returns the default values for this tuple."""
97

98
    def getElementStyle(self, index: int):
×
99
        """Returns the style of one element. Will never return AFXTUPLE_STYLE_DEFAULT!
100

101
        Parameters
102
        ----------
103
        index : int
104
            Element index.
105
        """
106

107
    def getElementType(self, index: int):
×
108
        """Returns the type of one element. Will never return AFXTUPLE_TYPE_DEFAULT!
109

110
        Parameters
111
        ----------
112
        index : int
113
            Element index.
114
        """
115

116
    def getFormattedValue(self, index: int):
×
117
        """Returns the formatted value of the tuple element, suitable for placing in a command. If the element
118
        has AFXTUPLE_EVALUATE style and its contents are invalid, an exception will be thrown.
119

120
        Parameters
121
        ----------
122
        index : int
123
            Element index.
124
        """
125

126
    def getLength(self):
×
127
        """Returns the length of the tuple."""
128

129
    def getMaxLength(self):
×
130
        """Returns the maximum length of this tuple, or -1 for unbounded length."""
131

132
    def getMinLength(self):
×
133
        """Returns the minimum length of this tuple."""
134

135
    def getTypeName(self):
×
136
        """Returns the name of the tuple keyword type.
137

138
        Implements AFXKeyword.
139
        """
140

141
    def getValue(self, index: int):
×
142
        """Returns the value of a tuple element.
143

144
        Parameters
145
        ----------
146
        index : int
147
            Element index.
148
        """
149

150
    def getValueAsDouble(self):
×
151
        """Returns the keyword's value as a float; returns False upon failure."""
152

153
    def getValueAsInt(self):
×
154
        """Returns the keyword's value as an integer; returns False upon failure."""
155

156
    def getValueAsString(self):
×
157
        """Returns the formatted string that represents the current keyword value in a command.
158

159
        Implements AFXKeyword.
160
        """
161

162
    def getValueForBlank(self, index: int):
×
163
        """Returns the value substituted for blank tuple element.
164

165
        Parameters
166
        ----------
167
        index : int
168
            Element index.
169
        """
170

171
    def getValues(self):
×
172
        """Returns a string containing values (separated by commas) of the tuple elements."""
173

174
    def getValuesForBlanks(self):
×
175
        """Returns a string containing values substituted for blanks for the tuple elements."""
176

177
    def insertElements(self, index: int, numCols: int):
×
178
        """Inserts elements starting at the given index.
179

180
        Parameters
181
        ----------
182
        index : int
183
            Starting index.
184
        numCols : int
185
            Number of elements to insert.
186
        """
187

188
    def isValueChanged(self):
×
189
        """Returns True if the keyword value differs from its previous value.
190

191
        Implements AFXKeyword.
192
        """
193

194
    def removeElements(self, index: int, numCols: int):
×
195
        """Removes elements starting at the given index.
196

197
        Parameters
198
        ----------
199
        index : int
200
            Starting index.
201
        numCols : int
202
            Number of elements to remove.
203
        """
204

205
    def setDefaultStyle(self, style: int):
×
206
        """Sets the default style for elements.
207

208
        Parameters
209
        ----------
210
        style : int
211
            New default element style.
212
        """
213

214
    def setDefaultType(self, type: int):
×
215
        """Sets the default type for elements.
216

217
        Parameters
218
        ----------
219
        type : int
220
            New default type.
221
        """
222

223
    def setDefaultValues(self, values: str):
×
224
        """Sets the default values for this tuple.
225

226
        Parameters
227
        ----------
228
        values : str
229
            Sequence string with default values.
230
        """
231

232
    def setElementStyle(self, index: int, style: int):
×
233
        """Sets the style of one element.
234

235
        Parameters
236
        ----------
237
        index : int
238
            Element index.
239
        style : int
240
            New element style.
241
        """
242

243
    def setElementType(self, index: int, type: int):
×
244
        """Sets the type of one element.
245

246
        Parameters
247
        ----------
248
        index : int
249
            Element index.
250
        type : int
251
            New element type.
252
        """
253

254
    def setLengthRange(self, minLength: int, maxLength: int):
×
255
        """Sets the range of allowable tuple lengths.
256

257
        Parameters
258
        ----------
259
        minLength : int
260
            New minimum length.
261
        maxLength : int
262
            New maximum length, or -1 for unbounded length.
263
        """
264

265
    def setMaxLength(self, length: int):
×
266
        """Sets the maximum length of this tuple.
267

268
        Parameters
269
        ----------
270
        length : int
271
            New maximum length, or -1 for unbounded length.
272
        """
273

274
    def setMinLength(self, length: int):
×
275
        """Sets the minimum length of this tuple.
276

277
        Parameters
278
        ----------
279
        length : int
280
            New minimum length.
281
        """
282

283
    def setValue(self, index: int, value: str):
×
284
        """Sets the value of the tuple element; returns False upon failure.
285

286
        Parameters
287
        ----------
288
        index : int
289
            Element index.
290
        value : str
291
            New value.
292
        """
293

294
    def setValueForBlank(self, index: int, value: str):
×
295
        """Sets the value substituted for a blank tuple element.
296

297
        Parameters
298
        ----------
299
        index : int
300
            Element index.
301
        value : str
302
            New value.
303
        """
304

305
    def setValues(self, values: str):
×
306
        """Sets values for all tuple elements (use commas to separate values within the string).
307

308
        Parameters
309
        ----------
310
        values : str
311
            Tuple string with new values.
312
        """
313

314
    def setValuesForBlanks(self, values: str):
×
315
        """Sets all values substituted for blanks for the tuple elements.
316

317
        Parameters
318
        ----------
319
        values : str
320
            Tuple string with values.
321
        """
322

323
    def setValueToDefault(self, ignoreUnspecified: bool = False):
×
324
        """Sets the keyword value to its default.
325

326
        Parameters
327
        ----------
328
        ignoreUnspecified : bool
329
            Should ignore if default is an unspecified value.
330
        """
331

332
    def setValueToPrevious(self):
×
333
        """Sets the keyword value to its previous value.
334

335
        Implements AFXKeyword.
336
        """
337

338
    def syncPreviousValue(self):
×
339
        """Sets the keyword's previous value to its current value.
340

341
        Implements AFXKeyword.
342
        """
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc