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

haiiliin / abqpy / 6438599206

07 Oct 2023 02:54AM UTC coverage: 73.811% (-0.01%) from 73.825%
6438599206

push

github

web-flow
[bugfix] Fix `AFXMainWindow` methods return types (backport #5286) (#5293)

[bugfix] Fix `AFXMainWindow` methods return types (#5286)

* [bugfix] Fix AFXMainWindow return types

* Remove toolboxName argument for registerGuiMenuButton

(cherry picked from commit 51df0fc24)

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

36 of 36 new or added lines in 5 files covered. (100.0%)

24137 of 32701 relevant lines covered (73.81%)

0.74 hits per line

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

0.0
/src/abaqus/PlugInRegistration/KernelPlugInCommands.py
1
"""Kernel plug-in commands register kernel plug-ins in either the **Plug-ins** menu or in a toolbox.
2

3
These functions can be accessed by::
4

5
    from abaqusGui import getAFXApp
6
    toolset=getAFXApp().getAFXMainWindow().getPluginToolset()
7
"""
8
from typing import Sequence
×
9

10
from ..UtilityAndView.abaqusConstants import ALL, SymbolicConstant
×
11
from .FXIcon import FXIcon
×
12
from .PluginToolsetBase import PluginToolsetBase
×
13

14

15
class KernelPluginToolset(PluginToolsetBase):
×
16
    def registerKernelMenuButton(
×
17
        self,
18
        moduleName: str,
19
        functionName: str,
20
        buttonText: str = "",
21
        icon: FXIcon | None = None,
22
        applicableModules: SymbolicConstant | Sequence[str] = ALL,
23
        version: str = "N/A",
24
        author: str = "N/A",
25
        description: str = "N/A",
26
        helpUrl: str = "N/A",
27
    ):
28
        """Registers a kernel plug-in in the Plug-ins menu.
29

30
        Parameters
31
        ----------
32
        moduleName : str
33
            A String specifying the name of the module to be imported. The module must contain the function to be executed.
34
        functionName : str
35
            A String specifying the name of the function to be executed. The function must be located in moduleName.
36
        buttonText : str, optional
37
            A String specifying the text to be displayed in the Plug-ins menu. Use a pipe ( | ) between words to specify
38
            submenus. The default value is the empty string.
39
        icon : str, optional
40
            A FXIcon object specifying an icon to be displayed to the left of the text in the menu. For more information,
41
            see afxCreateIcon in the “Auxiliary functions” section of this guide. The default value is None.
42
        applicableModules : str, optional
43
            The SymbolicConstant ALL or a sequence of one or more Strings specifying the list of modules to which this
44
            plug-in applies. If a plug-in is not applicable to a module, it will be hidden when the user switches into that
45
            module. Possible values of the Strings in the sequence are “Part”, “Property”, “Assembly”, “Step”,
46
            “Interaction”, “Load”, “Mesh”, “Job”, “Visualization”, and “Sketch”. The default value is ALL.
47
        version : str, optional
48
            A String specifying the version of the plug-in. The version is displayed in the About Plug-ins dialog box.
49
            The default value is “N/A”.
50
        author : str, optional
51
            A String specifying the author of the plug-in. The author is displayed in the About Plug-ins dialog box.
52
            The default value is “N/A”.
53
        description : str, optional
54
            A String specifying the description of the plug-in. The description is displayed in the About Plug-ins dialog
55
            box. The default value is “N/A”.
56
        helpUrl : str, optional
57
            A String specifying the universal resource locator (URL) that points to the help for this plug-in. This URL can
58
            be loaded in a web browser from the View button in the About Plug-ins dialog box. The default value is “N/A”.
59
        """
60

61
    def registerKernelToolButton(
×
62
        self,
63
        toolboxName: str,
64
        moduleName: str,
65
        functionName: str,
66
        buttonText: str = "",
67
        icon: FXIcon | None = None,
68
        applicableModules: SymbolicConstant | Sequence[str] = ALL,
69
        version: str = "N/A",
70
        author: str = "N/A",
71
        description: str = "N/A",
72
        helpUrl: str = "N/A",
73
    ):
74
        """Registers a kernel plug-in in a toolbox.
75

76
        Parameters
77
        ----------
78
        toolboxName : str
79
            A String specifying the name of the toolbox in which the button will be shown. The name appears in the toolbox
80
            title bar.
81
        moduleName : str
82
            A String specifying the name of the module to be imported. The module must contain the function to be executed.
83
        functionName : str
84
            A String specifying the name of the function to be executed. The function must be located in _moduleName_.
85
        buttonText : str, optional
86
            A String specifying the text to be displayed in the Plug-ins menu. The default value is the empty string.
87
        icon : str, optional
88
            A FXIcon object specifying an icon to be displayed to the left of the text in the menu. For more information,
89
            see afxCreateIcon in the “Auxiliary functions” section of this guide. The default value is None.
90
        applicableModules : str, optional
91
            The SymbolicConstant ALL or a sequence of one or more Strings specifying the list of modules to which this
92
            plug-in applies. If a plug-in is not applicable to a module, it will be hidden when the user switches into that
93
            module. Possible values of the Strings in the sequence are “Part”, “Property”, “Assembly”, “Step”,
94
            “Interaction”, “Load”, “Mesh”, “Job”, “Visualization”, and “Sketch”. The default value is ALL.
95
        version : str, optional
96
            A String specifying the version of the plug-in. The version is displayed in the About Plug-ins dialog box.
97
            The default value is “N/A”.
98
        author : str, optional
99
            A String specifying the author of the plug-in. The author is displayed in the About Plug-ins dialog box. The
100
            default value is “N/A”.
101
        description : str, optional
102
            A String specifying the description of the plug-in. The description is displayed in the About Plug-ins dialog
103
            box. The default value is “N/A”.
104
        helpUrl : str, optional
105
            A String specifying the universal resource locator (URL) that points to the help for this plug-in. This URL can
106
            be loaded in a web browser from the View button in the About Plug-ins dialog box. The default value is “N/A”.
107
        """
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

© 2025 Coveralls, Inc