eric7/Plugins/PluginEricapi.py

branch
eric7
changeset 8314
e3642a6a1e71
parent 8312
800c432b34c8
child 8318
962bce857696
equal deleted inserted replaced
8313:dac33c7fce07 8314:e3642a6a1e71
17 from E5Gui.E5Action import E5Action 17 from E5Gui.E5Action import E5Action
18 18
19 import Utilities 19 import Utilities
20 import UI.Info 20 import UI.Info
21 21
22 from eric6config import getConfig 22 from eric7config import getConfig
23 23
24 # Start-Of-Header 24 # Start-Of-Header
25 name = "Ericapi Plugin" 25 name = "Ericapi Plugin"
26 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 26 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
27 autoactivate = True 27 autoactivate = True
46 Public method to support the display of some executable info. 46 Public method to support the display of some executable info.
47 47
48 @return dictionary containing the data to query the presence of 48 @return dictionary containing the data to query the presence of
49 the executable 49 the executable
50 """ 50 """
51 exe = 'eric6_api' 51 exe = 'eric7_api'
52 if Utilities.isWindowsPlatform(): 52 if Utilities.isWindowsPlatform():
53 exe = os.path.join(getConfig("bindir"), exe + '.cmd') 53 exe = os.path.join(getConfig("bindir"), exe + '.cmd')
54 if not os.path.exists(exe): 54 if not os.path.exists(exe):
55 exe = os.path.join(getConfig("bindir"), exe + '.bat') 55 exe = os.path.join(getConfig("bindir"), exe + '.bat')
56 else: 56 else:
60 "programEntry": True, 60 "programEntry": True,
61 "header": QCoreApplication.translate( 61 "header": QCoreApplication.translate(
62 "EricapiPlugin", "eric API File Generator"), 62 "EricapiPlugin", "eric API File Generator"),
63 "exe": exe, 63 "exe": exe,
64 "versionCommand": '--version', 64 "versionCommand": '--version',
65 "versionStartsWith": 'eric6_', 65 "versionStartsWith": 'eric7_',
66 "versionPosition": -3, 66 "versionPosition": -3,
67 "version": "", 67 "version": "",
68 "versionCleanup": None, 68 "versionCleanup": None,
69 } 69 }
70 70
98 @return tuple of None and activation status (boolean) 98 @return tuple of None and activation status (boolean)
99 """ 99 """
100 menu = e5App().getObject("Project").getMenu("Apidoc") 100 menu = e5App().getObject("Project").getMenu("Apidoc")
101 if menu: 101 if menu:
102 self.__projectAct = E5Action( 102 self.__projectAct = E5Action(
103 self.tr('Generate API file (eric6_api)'), 103 self.tr('Generate API file (eric7_api)'),
104 self.tr('Generate &API file (eric6_api)'), 0, 0, 104 self.tr('Generate &API file (eric7_api)'), 0, 0,
105 self, 'doc_eric6_api') 105 self, 'doc_eric7_api')
106 self.__projectAct.setStatusTip(self.tr( 106 self.__projectAct.setStatusTip(self.tr(
107 'Generate an API file using eric6_api')) 107 'Generate an API file using eric7_api'))
108 self.__projectAct.setWhatsThis(self.tr( 108 self.__projectAct.setWhatsThis(self.tr(
109 """<b>Generate API file</b>""" 109 """<b>Generate API file</b>"""
110 """<p>Generate an API file using eric6_api.</p>""" 110 """<p>Generate an API file using eric7_api.</p>"""
111 )) 111 ))
112 self.__projectAct.triggered.connect(self.__doEricapi) 112 self.__projectAct.triggered.connect(self.__doEricapi)
113 e5App().getObject("Project").addE5Actions([self.__projectAct]) 113 e5App().getObject("Project").addE5Actions([self.__projectAct])
114 menu.addAction(self.__projectAct) 114 menu.addAction(self.__projectAct)
115 115
143 e5App().getObject("Project").getProjectLanguage() in 143 e5App().getObject("Project").getProjectLanguage() in
144 ["Python", "Python3", "Ruby", "MicroPython"]) 144 ["Python", "Python3", "Ruby", "MicroPython"])
145 145
146 def __doEricapi(self): 146 def __doEricapi(self):
147 """ 147 """
148 Private slot to perform the eric6_api api generation. 148 Private slot to perform the eric7_api api generation.
149 """ 149 """
150 from DocumentationPlugins.Ericapi.EricapiConfigDialog import ( 150 from DocumentationPlugins.Ericapi.EricapiConfigDialog import (
151 EricapiConfigDialog 151 EricapiConfigDialog
152 ) 152 )
153 eolTranslation = { 153 eolTranslation = {

eric ide

mercurial