Plugins/PluginEricdoc.py

changeset 3670
f0cb7579c0b4
parent 3656
441956d8fce5
child 3677
a53cf139293f
equal deleted inserted replaced
3669:ac84ac3c0f05 3670:f0cb7579c0b4
18 18
19 from E5Gui.E5Action import E5Action 19 from E5Gui.E5Action import E5Action
20 20
21 import Utilities 21 import Utilities
22 22
23 from eric5config import getConfig 23 from eric6config import getConfig
24 24
25 # Start-Of-Header 25 # Start-Of-Header
26 name = "Ericdoc Plugin" 26 name = "Ericdoc Plugin"
27 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 27 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
28 autoactivate = True 28 autoactivate = True
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 dataList = [] 51 dataList = []
52 52
53 # 1. eric5_doc 53 # 1. eric6_doc
54 exe = 'eric5_doc' 54 exe = 'eric6_doc'
55 if Utilities.isWindowsPlatform(): 55 if Utilities.isWindowsPlatform():
56 exe = os.path.join(getConfig("bindir"), exe + '.bat') 56 exe = os.path.join(getConfig("bindir"), exe + '.bat')
57 dataList.append({ 57 dataList.append({
58 "programEntry": True, 58 "programEntry": True,
59 "header": QCoreApplication.translate( 59 "header": QCoreApplication.translate(
60 "EricdocPlugin", "Eric5 Documentation Generator"), 60 "EricdocPlugin", "Eric6 Documentation Generator"),
61 "exe": exe, 61 "exe": exe,
62 "versionCommand": '--version', 62 "versionCommand": '--version',
63 "versionStartsWith": 'eric5_', 63 "versionStartsWith": 'eric6_',
64 "versionPosition": -3, 64 "versionPosition": -3,
65 "version": "", 65 "version": "",
66 "versionCleanup": None, 66 "versionCleanup": None,
67 }) 67 })
68 68
129 """ 129 """
130 menu = e5App().getObject("Project").getMenu("Apidoc") 130 menu = e5App().getObject("Project").getMenu("Apidoc")
131 if menu: 131 if menu:
132 self.__projectAct = \ 132 self.__projectAct = \
133 E5Action( 133 E5Action(
134 self.tr('Generate documentation (eric5_doc)'), 134 self.tr('Generate documentation (eric6_doc)'),
135 self.tr('Generate &documentation (eric5_doc)'), 0, 0, 135 self.tr('Generate &documentation (eric6_doc)'), 0, 0,
136 self, 'doc_eric5_doc') 136 self, 'doc_eric6_doc')
137 self.__projectAct.setStatusTip( 137 self.__projectAct.setStatusTip(
138 self.tr('Generate API documentation using eric5_doc')) 138 self.tr('Generate API documentation using eric6_doc'))
139 self.__projectAct.setWhatsThis(self.tr( 139 self.__projectAct.setWhatsThis(self.tr(
140 """<b>Generate documentation</b>""" 140 """<b>Generate documentation</b>"""
141 """<p>Generate API documentation using eric5_doc.</p>""" 141 """<p>Generate API documentation using eric6_doc.</p>"""
142 )) 142 ))
143 self.__projectAct.triggered.connect(self.__doEricdoc) 143 self.__projectAct.triggered.connect(self.__doEricdoc)
144 e5App().getObject("Project").addE5Actions([self.__projectAct]) 144 e5App().getObject("Project").addE5Actions([self.__projectAct])
145 menu.addAction(self.__projectAct) 145 menu.addAction(self.__projectAct)
146 146
175 e5App().getObject("Project").getProjectLanguage() in 175 e5App().getObject("Project").getProjectLanguage() in
176 ["Python", "Python2", "Python3", "Ruby"]) 176 ["Python", "Python2", "Python3", "Ruby"])
177 177
178 def __doEricdoc(self): 178 def __doEricdoc(self):
179 """ 179 """
180 Private slot to perform the eric5_doc api documentation generation. 180 Private slot to perform the eric6_doc api documentation generation.
181 """ 181 """
182 from DocumentationPlugins.Ericdoc.EricdocConfigDialog import \ 182 from DocumentationPlugins.Ericdoc.EricdocConfigDialog import \
183 EricdocConfigDialog 183 EricdocConfigDialog
184 eolTranslation = { 184 eolTranslation = {
185 '\r': 'cr', 185 '\r': 'cr',
206 if res: 206 if res:
207 dia.exec_() 207 dia.exec_()
208 208
209 outdir = Utilities.toNativeSeparators(parms['outputDirectory']) 209 outdir = Utilities.toNativeSeparators(parms['outputDirectory'])
210 if outdir == '': 210 if outdir == '':
211 outdir = 'doc' # that is eric5_docs default output dir 211 outdir = 'doc' # that is eric6_docs default output dir
212 212
213 # add it to the project data, if it isn't in already 213 # add it to the project data, if it isn't in already
214 outdir = project.getRelativePath(outdir) 214 outdir = project.getRelativePath(outdir)
215 if outdir not in project.pdata['OTHERS']: 215 if outdir not in project.pdata['OTHERS']:
216 project.pdata['OTHERS'].append(outdir) 216 project.pdata['OTHERS'].append(outdir)
220 if parms['qtHelpEnabled']: 220 if parms['qtHelpEnabled']:
221 outdir = Utilities.toNativeSeparators( 221 outdir = Utilities.toNativeSeparators(
222 parms['qtHelpOutputDirectory']) 222 parms['qtHelpOutputDirectory'])
223 if outdir == '': 223 if outdir == '':
224 outdir = 'help' 224 outdir = 'help'
225 # that is eric5_docs default QtHelp output dir 225 # that is eric6_docs default QtHelp output dir
226 226
227 # add it to the project data, if it isn't in already 227 # add it to the project data, if it isn't in already
228 outdir = project.getRelativePath(outdir) 228 outdir = project.getRelativePath(outdir)
229 if outdir not in project.pdata['OTHERS']: 229 if outdir not in project.pdata['OTHERS']:
230 project.pdata['OTHERS'].append(outdir) 230 project.pdata['OTHERS'].append(outdir)

eric ide

mercurial