• 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/AFXComTableKeyword.py
1
from __future__ import annotations
×
2

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

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

9
#: Column type is the same as the table default type.
10
AFXTABLE_TYPE_DEFAULT: int = hash("AFXTABLE_TYPE_DEFAULT")
×
11

12
#: Column stores integer numbers.
13
AFXTABLE_TYPE_INT: int = hash("AFXTABLE_TYPE_INT")
×
14

15
#: Column stores floating-point numbers.
16
AFXTABLE_TYPE_FLOAT: int = hash("AFXTABLE_TYPE_FLOAT")
×
17

18
#: Column stores string values.
19
AFXTABLE_TYPE_STRING: int = hash("AFXTABLE_TYPE_STRING")
×
20

21
#: Column stores True or False.
22
AFXTABLE_TYPE_BOOL: int = hash("AFXTABLE_TYPE_BOOL")
×
23

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

27
#: Allow empty values for the column elements.
28
AFXTABLE_ALLOW_EMPTY: int = hash("AFXTABLE_ALLOW_EMPTY")
×
29

30
#: Always substitute the default for empty values.
31
AFXTABLE_DEFAULT_IF_EMPTY: int = hash("AFXTABLE_DEFAULT_IF_EMPTY")
×
32

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

36
#: Use table default column style.
37
AFXTABLE_STYLE_DEFAULT: int = hash("AFXTABLE_STYLE_DEFAULT")
×
38

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

42

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

46
    #: ID for AFXTable widgets.
47
    ID_TABLE: int = hash("ID_TABLE")
×
48

49
    #: ID for widgets exchanging array strings.
50
    ID_VALUE: int = hash("ID_VALUE")
×
51

52
    #: For debugging.
53
    ID_PRINTSNIPPET: int = hash("ID_PRINTSNIPPET")
×
54

55
    def __init__(
×
56
        self,
57
        command: AFXCommand,
58
        name: str,
59
        isRequired: bool = False,
60
        minLength: int = 0,
61
        maxLength: int = -1,
62
        opts: int = 0,
63
    ):
64
        """Constructor.
65

66
        Parameters
67
        ----------
68
        command : AFXCommand
69
            Host command.
70
        name : str
71
            Keyword name.
72
        isRequired : bool
73
            True if this keyword is a required argument.
74
        minLength : int
75
            Minimum (and default) row length.
76
        maxLength : int
77
            Maximum row length (-1 => unlimited).
78
        opts : int
79
            Options.
80
        """
81

82
    def equal(self, index: int, a: str, b: str):
×
83
        """Returns True if the two table element values compare equal (index not used).
84

85
        Parameters
86
        ----------
87
        index : int
88
            Element index (not used).
89
        a : str
90
            First value.
91
        b : str
92
            Second value.
93
        """
94

95
    def getColumnStyle(self, index: int):
×
96
        """Returns the style of the column elements. Will never return AFXTABLE_STYLE_DEFAULT!
97

98
        Parameters
99
        ----------
100
        index : int
101
            Column index.
102
        """
103

104
    def getColumnType(self, index: int):
×
105
        """Returns the type of the column elements. Will never return AFXTABLE_TYPE_DEFAULT!
106

107
        Parameters
108
        ----------
109
        index : int
110
            Column index.
111
        """
112

113
    def getDefaultStyle(self):
×
114
        """Returns the default style for the table elements."""
115

116
    def getDefaultType(self):
×
117
        """Returns the default type for the table elements."""
118

119
    def getDefaultValues(self):
×
120
        """Returns the default values for this table."""
121

122
    def getFormattedValue(self, row: int, column: int):
×
123
        """Returns the formatted value of the table element, suitable for placing in a command. If the element
124
        has AFXTABLE_EVALUATE style, and its contents are invalid, an exception will be thrown.
125

126
        Parameters
127
        ----------
128
        row : int
129
            Row index.
130
        column : int
131
            Column index.
132
        """
133

134
    def getMaxNumColumns(self):
×
135
        """Returns the maximum number of columns, or -1 for unbounded."""
136

137
    def getMinNumColumns(self):
×
138
        """Returns the minimum number of columns."""
139

140
    def getNumColumns(self, row: int):
×
141
        """Returns the number of columns in the row.
142

143
        Parameters
144
        ----------
145
        row : int
146
            Row index.
147
        """
148

149
    def getNumRows(self):
×
150
        """Returns the number of rows in the table."""
151

152
    def getRow(self, row: int):
×
153
        """Returns a string with the contents of a table row.
154

155
        Parameters
156
        ----------
157
        row : int
158
            Row index.
159
        """
160

161
    def getTypeName(self):
×
162
        """Returns the name of the table keyword type.
163

164
        Implements AFXKeyword. Reimplemented in AFXTableKeyword.
165
        """
166

167
    def getValue(self, row: int, column: int):
×
168
        """Returns the value of a table element.
169

170
        Parameters
171
        ----------
172
        row : int
173
            Row index.
174
        column : int
175
            Column index.
176
        """
177

178
    def getValueAsDouble(self):
×
179
        """Returns the keyword's value as a float; returns False upon failure."""
180

181
    def getValueAsInt(self):
×
182
        """Returns the keyword's value as an integer; returns False upon failure."""
183

184
    def getValueAsString(self):
×
185
        """Returns the formatted string that represents the current keyword value in a command.
186

187
        Implements AFXKeyword.
188
        """
189

190
    def getValueForBlank(self, column: int):
×
191
        """Returns the element value substituted for blank for the column.
192

193
        Parameters
194
        ----------
195
        column : int
196
            Column index.
197
        """
198

199
    def getValues(self):
×
200
        """Returns a string containing values of the tuple elements.
201

202
        as entered by the user.
203
        """
204

205
    def getValuesForBlanks(self):
×
206
        """Returns a string with values substituted for blanks for all table columns."""
207

208
    def insertColumns(self, index: int, numColumns: int):
×
209
        """Inserts columns starting at the given index.
210

211
        Parameters
212
        ----------
213
        index : int
214
            Starting index.
215
        numColumns : int
216
            Number of columns to insert.
217
        """
218

219
    def insertRows(self, index: int, numRows: int):
×
220
        """Inserts rows starting at the given index.
221

222
        Parameters
223
        ----------
224
        index : int
225
            Starting index.
226
        numRows : int
227
            Number of rows to insert.
228
        """
229

230
    def isValueChanged(self):
×
231
        """Returns True if the keyword value differs from its previous value.
232

233
        Implements AFXKeyword.
234
        """
235

236
    def removeColumns(self, index: int, numColumns: int):
×
237
        """Removes columns starting at the given index.
238

239
        Parameters
240
        ----------
241
        index : int
242
            Starting index.
243
        numColumns : int
244
            Number of columns to remove.
245
        """
246

247
    def removeRows(self, index: int, numRows: int):
×
248
        """Removes rows starting at the given index.
249

250
        Parameters
251
        ----------
252
        index : int
253
            Starting index.
254
        numRows : int
255
            Number of rows to remove.
256
        """
257

258
    def setColumnStyle(self, index: int, style: int):
×
259
        """Sets the style of the column elements.
260

261
        Parameters
262
        ----------
263
        index : int
264
            Column index.
265
        style : int
266
            New column style.
267
        """
268

269
    def setColumnType(self, index: int, type: int):
×
270
        """Sets the type of the column elements.
271

272
        Parameters
273
        ----------
274
        index : int
275
            Column index.
276
        type : int
277
            New column type.
278
        """
279

280
    def setDefaultStyle(self, style: int):
×
281
        """Sets the default style for the table elements.
282

283
        Parameters
284
        ----------
285
        style : int
286
            New default style.
287
        """
288

289
    def setDefaultType(self, type: int):
×
290
        """Sets the default type for table elements.
291

292
        Parameters
293
        ----------
294
        type : int
295
            New default type.
296
        """
297

298
    def setDefaultValues(self, values: str):
×
299
        """Sets the default values for this table.
300

301
        Parameters
302
        ----------
303
        values : str
304
            Sequence string with default values.
305
        """
306

307
    def setMaxNumColumns(self, length: int):
×
308
        """Sets the maximum number of columns.
309

310
        Parameters
311
        ----------
312
        length : int
313
            New maximum number of columns, or -1 for unbounded.
314
        """
315

316
    def setMinNumColumns(self, length: int):
×
317
        """Sets the minimum number of columns.
318

319
        Parameters
320
        ----------
321
        length : int
322
            New minimum length.
323
        """
324

325
    def setNumColumnsRange(self, minLength: int, maxLength: int):
×
326
        """Sets the allowable range for the number of columns.
327

328
        Parameters
329
        ----------
330
        minLength : int
331
            New minimum number of columns.
332
        maxLength : int
333
            New maximum number of columns, or -1 for unbounded.
334
        """
335

336
    def setRow(self, row: int, seq: str):
×
337
        """Sets the contents of a table row.
338

339
        Parameters
340
        ----------
341
        row : int
342
            Row index.
343
        seq : str
344
            Sequence with elements.
345
        """
346

347
    def setValue(self, row: int, column: int, value: str):
×
348
        """Sets the value of a table element.
349

350
        Parameters
351
        ----------
352
        row : int
353
            Row index.
354
        column : int
355
            Column index.
356
        value : str
357
            New value.
358
        """
359

360
    def setValueForBlank(self, column: int, value: str):
×
361
        """Sets the element value substituted for blank for the column.
362

363
        Parameters
364
        ----------
365
        column : int
366
            Column index.
367
        value : str
368
            New value.
369
        """
370

371
    def setValues(self, values: str):
×
372
        """Sets all values for the table elements.
373

374
        Parameters
375
        ----------
376
        values : str
377
            Table string with new values.
378
        """
379

380
    def setValuesForBlanks(self, values: str):
×
381
        """Sets the values substituted for blanks for all table columns.
382

383
        Parameters
384
        ----------
385
        values : str
386
            String containing comma-separated values.
387
        """
388

389
    def setValueToDefault(self, ignoreUnspecified: bool = False):
×
390
        """Sets the keyword value to its default.
391

392
        Parameters
393
        ----------
394
        ignoreUnspecified : bool
395
            Should ignore if default is an unspecified value.
396
        """
397

398
    def setValueToPrevious(self):
×
399
        """Sets the keyword value to its previous value.
400

401
        Implements AFXKeyword.
402
        """
403

404
    def syncPreviousValue(self):
×
405
        """Sets the keyword's previous value to its current value.
406

407
        Implements AFXKeyword.
408
        """
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