112 |
114 |
113 def activate(self): |
115 def activate(self): |
114 """ |
116 """ |
115 Public method to activate this plugin. |
117 Public method to activate this plugin. |
116 |
118 |
117 @return tuple of None and activation status (boolean) |
119 @return tuple of None and activation status |
|
120 @rtype bool |
118 """ |
121 """ |
119 menu = ericApp().getObject("Project").getMenu("Apidoc") |
122 menu = ericApp().getObject("Project").getMenu("Apidoc") |
120 if menu: |
123 if menu: |
121 self.__projectAct = EricAction( |
124 self.__projectAct = EricAction( |
122 self.tr("Generate API file (eric7_api)"), |
125 self.tr("Generate API file (eric7_api)"), |
158 def __projectShowMenu(self, menuName, menu): # noqa: U100 |
161 def __projectShowMenu(self, menuName, menu): # noqa: U100 |
159 """ |
162 """ |
160 Private slot called, when the the project menu or a submenu is |
163 Private slot called, when the the project menu or a submenu is |
161 about to be shown. |
164 about to be shown. |
162 |
165 |
163 @param menuName name of the menu to be shown (string) |
166 @param menuName name of the menu to be shown |
164 @param menu reference to the menu (QMenu) |
167 @type str |
|
168 @param menu reference to the menu |
|
169 @type QMenu |
165 """ |
170 """ |
166 if menuName == "Apidoc" and self.__projectAct is not None: |
171 if menuName == "Apidoc" and self.__projectAct is not None: |
167 self.__projectAct.setEnabled( |
172 self.__projectAct.setEnabled( |
168 ericApp().getObject("Project").getProjectLanguage() |
173 ericApp().getObject("Project").getProjectLanguage() |
169 in ["Python", "Python3", "Ruby", "MicroPython"] |
174 in ["Python", "Python3", "Ruby", "MicroPython"] |