Exemplo n.º 1
0
 def __doEricdoc(self):
     """
     Private slot to perform the eric6_doc api documentation generation.
     """
     from DocumentationPlugins.Ericdoc.EricdocConfigDialog import \
         EricdocConfigDialog
     eolTranslation = {
         '\r': 'cr',
         '\n': 'lf',
         '\r\n': 'crlf',
     }
     project = e5App().getObject("Project")
     parms = project.getData('DOCUMENTATIONPARMS', "ERIC4DOC")
     dlg = EricdocConfigDialog(project, parms)
     if dlg.exec_() == QDialog.Accepted:
         args, parms = dlg.generateParameters()
         project.setData('DOCUMENTATIONPARMS', "ERIC4DOC", parms)
         
         # add parameter for the eol setting
         if not project.useSystemEol():
             args.append(
                 "--eol={0}".format(eolTranslation[project.getEolString()]))
         
         # now do the call
         from DocumentationPlugins.Ericdoc.EricdocExecDialog import \
             EricdocExecDialog
         dia = EricdocExecDialog("Ericdoc")
         res = dia.start(args, project.ppath)
         if res:
             dia.exec_()
         
         outdir = Utilities.toNativeSeparators(parms['outputDirectory'])
         if outdir == '':
             outdir = 'doc'      # that is eric6_docs default output dir
             
         # add it to the project data, if it isn't in already
         outdir = project.getRelativePath(outdir)
         if outdir not in project.pdata['OTHERS']:
             project.pdata['OTHERS'].append(outdir)
             project.setDirty(True)
             project.othersAdded(outdir)
         
         if parms['qtHelpEnabled']:
             outdir = Utilities.toNativeSeparators(
                 parms['qtHelpOutputDirectory'])
             if outdir == '':
                 outdir = 'help'
                 # that is eric6_docs default QtHelp output dir
                 
             # add it to the project data, if it isn't in already
             outdir = project.getRelativePath(outdir)
             if outdir not in project.pdata['OTHERS']:
                 project.pdata['OTHERS'].append(outdir)
                 project.setDirty(True)
                 project.othersAdded(outdir)
 def __doEricdoc(self):
     """
     Private slot to perform the eric4_doc api documentation generation.
     """
     project = e4App().getObject("Project")
     parms = project.getData('DOCUMENTATIONPARMS', "ERIC4DOC")
     dlg = EricdocConfigDialog(project, parms)
     if dlg.exec_() == QDialog.Accepted:
         args, parms = dlg.generateParameters()
         project.setData('DOCUMENTATIONPARMS', "ERIC4DOC", parms)
         
         # now do the call
         dia = EricdocExecDialog("Ericdoc")
         res = dia.start(args, project.ppath)
         if res:
             dia.exec_()
         
         outdir = parms['outputDirectory']
         if outdir == '':
             outdir = 'doc'      # that is eric4_docs default output dir
             
         # add it to the project data, if it isn't in already
         outdir = project.getRelativePath(outdir)
         if outdir not in project.pdata['OTHERS']:
             project.pdata['OTHERS'].append(outdir)
             project.setDirty(True)
             project.othersAdded(outdir)
         
         if parms['qtHelpEnabled']:
             outdir = parms['qtHelpOutputDirectory']
             if outdir == '':
                 outdir = 'help'      # that is eric4_docs default QtHelp output dir
                 
             # add it to the project data, if it isn't in already
             outdir = project.getRelativePath(outdir)
             if outdir not in project.pdata['OTHERS']:
                 project.pdata['OTHERS'].append(outdir)
                 project.setDirty(True)
                 project.othersAdded(outdir)