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. eric6_doc |
53 # 1. eric7_doc |
54 exe = 'eric6_doc' |
54 exe = 'eric7_doc' |
55 if Utilities.isWindowsPlatform(): |
55 if Utilities.isWindowsPlatform(): |
56 exe = os.path.join(getConfig("bindir"), exe + '.cmd') |
56 exe = os.path.join(getConfig("bindir"), exe + '.cmd') |
57 if not os.path.exists(exe): |
57 if not os.path.exists(exe): |
58 exe = os.path.join(getConfig("bindir"), exe + '.bat') |
58 exe = os.path.join(getConfig("bindir"), exe + '.bat') |
59 else: |
59 else: |
62 "programEntry": True, |
62 "programEntry": True, |
63 "header": QCoreApplication.translate( |
63 "header": QCoreApplication.translate( |
64 "EricdocPlugin", "eric Documentation Generator"), |
64 "EricdocPlugin", "eric Documentation Generator"), |
65 "exe": exe, |
65 "exe": exe, |
66 "versionCommand": '--version', |
66 "versionCommand": '--version', |
67 "versionStartsWith": 'eric6_', |
67 "versionStartsWith": 'eric7_', |
68 "versionPosition": -3, |
68 "versionPosition": -3, |
69 "version": "", |
69 "version": "", |
70 "versionCleanup": None, |
70 "versionCleanup": None, |
71 }) |
71 }) |
72 |
72 |
119 @return tuple of None and activation status (boolean) |
119 @return tuple of None and activation status (boolean) |
120 """ |
120 """ |
121 menu = e5App().getObject("Project").getMenu("Apidoc") |
121 menu = e5App().getObject("Project").getMenu("Apidoc") |
122 if menu: |
122 if menu: |
123 self.__projectAct = E5Action( |
123 self.__projectAct = E5Action( |
124 self.tr('Generate documentation (eric6_doc)'), |
124 self.tr('Generate documentation (eric7_doc)'), |
125 self.tr('Generate &documentation (eric6_doc)'), 0, 0, |
125 self.tr('Generate &documentation (eric7_doc)'), 0, 0, |
126 self, 'doc_eric6_doc') |
126 self, 'doc_eric7_doc') |
127 self.__projectAct.setStatusTip( |
127 self.__projectAct.setStatusTip( |
128 self.tr('Generate API documentation using eric6_doc')) |
128 self.tr('Generate API documentation using eric7_doc')) |
129 self.__projectAct.setWhatsThis(self.tr( |
129 self.__projectAct.setWhatsThis(self.tr( |
130 """<b>Generate documentation</b>""" |
130 """<b>Generate documentation</b>""" |
131 """<p>Generate API documentation using eric6_doc.</p>""" |
131 """<p>Generate API documentation using eric7_doc.</p>""" |
132 )) |
132 )) |
133 self.__projectAct.triggered.connect(self.__doEricdoc) |
133 self.__projectAct.triggered.connect(self.__doEricdoc) |
134 e5App().getObject("Project").addE5Actions([self.__projectAct]) |
134 e5App().getObject("Project").addE5Actions([self.__projectAct]) |
135 menu.addAction(self.__projectAct) |
135 menu.addAction(self.__projectAct) |
136 |
136 |
164 e5App().getObject("Project").getProjectLanguage() in |
164 e5App().getObject("Project").getProjectLanguage() in |
165 ["Python", "Python3", "Ruby", "MicroPython"]) |
165 ["Python", "Python3", "Ruby", "MicroPython"]) |
166 |
166 |
167 def __doEricdoc(self): |
167 def __doEricdoc(self): |
168 """ |
168 """ |
169 Private slot to perform the eric6_doc api documentation generation. |
169 Private slot to perform the eric7_doc api documentation generation. |
170 """ |
170 """ |
171 from DocumentationPlugins.Ericdoc.EricdocConfigDialog import ( |
171 from DocumentationPlugins.Ericdoc.EricdocConfigDialog import ( |
172 EricdocConfigDialog |
172 EricdocConfigDialog |
173 ) |
173 ) |
174 eolTranslation = { |
174 eolTranslation = { |
197 if res: |
197 if res: |
198 dia.exec() |
198 dia.exec() |
199 |
199 |
200 outdir = Utilities.toNativeSeparators(parms['outputDirectory']) |
200 outdir = Utilities.toNativeSeparators(parms['outputDirectory']) |
201 if outdir == '': |
201 if outdir == '': |
202 outdir = 'doc' # that is eric6_docs default output dir |
202 outdir = 'doc' # that is eric7_docs default output dir |
203 |
203 |
204 # add it to the project data, if it isn't in already |
204 # add it to the project data, if it isn't in already |
205 outdir = project.getRelativePath(outdir) |
205 outdir = project.getRelativePath(outdir) |
206 if outdir not in project.pdata['OTHERS']: |
206 if outdir not in project.pdata['OTHERS']: |
207 project.pdata['OTHERS'].append(outdir) |
207 project.pdata['OTHERS'].append(outdir) |
211 if parms['qtHelpEnabled']: |
211 if parms['qtHelpEnabled']: |
212 outdir = Utilities.toNativeSeparators( |
212 outdir = Utilities.toNativeSeparators( |
213 parms['qtHelpOutputDirectory']) |
213 parms['qtHelpOutputDirectory']) |
214 if outdir == '': |
214 if outdir == '': |
215 outdir = 'help' |
215 outdir = 'help' |
216 # that is eric6_docs default QtHelp output dir |
216 # that is eric7_docs default QtHelp output dir |
217 |
217 |
218 # add it to the project data, if it isn't in already |
218 # add it to the project data, if it isn't in already |
219 outdir = project.getRelativePath(outdir) |
219 outdir = project.getRelativePath(outdir) |
220 if outdir not in project.pdata['OTHERS']: |
220 if outdir not in project.pdata['OTHERS']: |
221 project.pdata['OTHERS'].append(outdir) |
221 project.pdata['OTHERS'].append(outdir) |