Plugins/PluginEricdoc.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2791
a9577f248f04
parent 3004
c4bf32c791d0
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
148 148
149 def deactivate(self): 149 def deactivate(self):
150 """ 150 """
151 Public method to deactivate this plugin. 151 Public method to deactivate this plugin.
152 """ 152 """
153 e5App().getObject("Project").showMenu.disconnect(self.__projectShowMenu) 153 e5App().getObject("Project").showMenu.disconnect(
154 self.__projectShowMenu)
154 155
155 menu = e5App().getObject("Project").getMenu("Apidoc") 156 menu = e5App().getObject("Project").getMenu("Apidoc")
156 if menu: 157 if menu:
157 menu.removeAction(self.__projectAct) 158 menu.removeAction(self.__projectAct)
158 e5App().getObject("Project").removeE5Actions([self.__projectAct]) 159 e5App().getObject("Project").removeE5Actions([self.__projectAct])
174 175
175 def __doEricdoc(self): 176 def __doEricdoc(self):
176 """ 177 """
177 Private slot to perform the eric5_doc api documentation generation. 178 Private slot to perform the eric5_doc api documentation generation.
178 """ 179 """
179 from DocumentationPlugins.Ericdoc.EricdocConfigDialog import EricdocConfigDialog 180 from DocumentationPlugins.Ericdoc.EricdocConfigDialog import \
181 EricdocConfigDialog
180 eolTranslation = { 182 eolTranslation = {
181 '\r': 'cr', 183 '\r': 'cr',
182 '\n': 'lf', 184 '\n': 'lf',
183 '\r\n': 'crlf', 185 '\r\n': 'crlf',
184 } 186 }
189 args, parms = dlg.generateParameters() 191 args, parms = dlg.generateParameters()
190 project.setData('DOCUMENTATIONPARMS', "ERIC4DOC", parms) 192 project.setData('DOCUMENTATIONPARMS', "ERIC4DOC", parms)
191 193
192 # add parameter for the eol setting 194 # add parameter for the eol setting
193 if not project.useSystemEol(): 195 if not project.useSystemEol():
194 args.append("--eol={0}".format(eolTranslation[project.getEolString()])) 196 args.append(
197 "--eol={0}".format(eolTranslation[project.getEolString()]))
195 198
196 # now do the call 199 # now do the call
197 from DocumentationPlugins.Ericdoc.EricdocExecDialog import EricdocExecDialog 200 from DocumentationPlugins.Ericdoc.EricdocExecDialog import \
201 EricdocExecDialog
198 dia = EricdocExecDialog("Ericdoc") 202 dia = EricdocExecDialog("Ericdoc")
199 res = dia.start(args, project.ppath) 203 res = dia.start(args, project.ppath)
200 if res: 204 if res:
201 dia.exec_() 205 dia.exec_()
202 206
210 project.pdata['OTHERS'].append(outdir) 214 project.pdata['OTHERS'].append(outdir)
211 project.setDirty(True) 215 project.setDirty(True)
212 project.othersAdded(outdir) 216 project.othersAdded(outdir)
213 217
214 if parms['qtHelpEnabled']: 218 if parms['qtHelpEnabled']:
215 outdir = Utilities.toNativeSeparators(parms['qtHelpOutputDirectory']) 219 outdir = Utilities.toNativeSeparators(
220 parms['qtHelpOutputDirectory'])
216 if outdir == '': 221 if outdir == '':
217 outdir = 'help' # that is eric5_docs default QtHelp output dir 222 outdir = 'help' # that is eric5_docs default QtHelp
223 # output dir
218 224
219 # add it to the project data, if it isn't in already 225 # add it to the project data, if it isn't in already
220 outdir = project.getRelativePath(outdir) 226 outdir = project.getRelativePath(outdir)
221 if outdir not in project.pdata['OTHERS']: 227 if outdir not in project.pdata['OTHERS']:
222 project.pdata['OTHERS'].append(outdir) 228 project.pdata['OTHERS'].append(outdir)

eric ide

mercurial