コード例 #1
0
ファイル: EDParallelExecute.py プロジェクト: rentreg/edna
 def waitForAllProcessToFinish(self):
     """
     as it names says, this method waits for all plug-ins which are currently running to finish before returning.
     """
     self.screen("Waiting for launched jobs to finish .")
     while (self.getNbRunning() > 0):
         time.sleep(1)
         sys.stderr.write(".")
     sys.stderr.write("Done.\n")
     EDJob.stats()
コード例 #2
0
 def waitForAllProcessToFinish(self):
     """
     as it names says, this method waits for all plug-ins which are currently running to finish before returning.
     """
     self.screen("Waiting for launched jobs to finish .")
     while (self.getNbRunning() > 0):
         time.sleep(1)
         sys.stderr.write(".")
     sys.stderr.write("Done.\n")
     EDJob.stats()
コード例 #3
0
ファイル: AzimuthalIntegration.py プロジェクト: kif/edna
 def process(self):
     for fn in self.dataFiles:
         EDVerbose.screen("Processing file %s" % fn)
         edj = EDJob(self.EDNAPluginName)
         edj.dataInput = self.fileName2xml(fn)
         edj.connectSUCCESS(self.XMLsuccess)
         edj.connectFAILURE(self.XMLerr)
         self.queue.put(edj)
         if self.process_sem._Semaphore__value > 0 :
             t = threading.Thread(target=self.startProcessing)
             t.start()
     EDVerbose.screen("Back in main")
     while self.cpu_sem._Semaphore__value < self.nbcpu:
         time.sleep(0.1)
     EDJob.synchronizeAll()
     EDJob.stats()
コード例 #4
0
 def statistics(self):
     """
     retrieve some statistics about past jobs.
     """
     with self.statLock:
         fStartStat = time.time()
         self.lastStatistics = EDJob.stats()
         self.lastStatistics += os.linesep + "Statistics collected on %s, the collect took: %.3fs" % (time.asctime(), time.time() - fStartStat)
     return self.lastStatistics
コード例 #5
0
ファイル: DocGenerator.py プロジェクト: gbourgh/edna
                if os.path.isfile(myPluginPath):
                    listOfPythonFiles = [myPluginPath]
                for onePyFile in findFile(pluginPath):
                    if not onePyFile in listOfPythonFiles:
                        listOfPythonFiles.append(onePyFile)
                if len(listOfPythonFiles) > 0:
                    epydocJob = EDJob("EDPluginExecEpydocv1_0")
                    dictJobs[oneplugin] = epydocJob
                    xsd = XSDataInputEpydoc()
                    xsd.setDocPath(XSDataFile(XSDataString(docPath)))
                    xsd.setProjectName(XSDataString(oneplugin))
                    xsd.setDocType(XSDataString(docFormat))
                    if bVerbose:
                        xsd.setVerbosity(XSDataInteger(2))
                    else:
                        xsd.setVerbosity(XSDataInteger(-1))
                    xsd.setSources([XSDataFile(XSDataString(oneFile)) for oneFile in listOfPythonFiles])
                    epydocJob.setDataInput(xsd)
                    epydocJob.execute()
                else:
                    print ("Error: No python files for plugin %s" % oneplugin)
    EDVerbose.screen("Back to main")
    for jobName in dictJobs:
        job = dictJobs[jobName]
        if job.getStatus() in [EDJob.PLUGIN_STATE_RUNNING, EDJob.PLUGIN_STATE_UNITIALIZED]:
            EDVerbose.screen("Waiting for job %s to finish" % jobName)
            job.synchronize()
    EDVerbose.screen("Generation of documentation finished")
    os.chdir(cwd)
    EDJob.stats()
コード例 #6
0
                if len(listOfPythonFiles) > 0:
                    epydocJob = EDJob("EDPluginExecEpydocv1_0")
                    dictJobs[oneplugin] = epydocJob
                    xsd = XSDataInputEpydoc()
                    xsd.setDocPath(XSDataFile(XSDataString(docPath)))
                    xsd.setProjectName(XSDataString(oneplugin))
                    xsd.setDocType(XSDataString(docFormat))
                    if bVerbose:
                        xsd.setVerbosity(XSDataInteger(2))
                    else:
                        xsd.setVerbosity(XSDataInteger(-1))
                    xsd.setSources([
                        XSDataFile(XSDataString(oneFile))
                        for oneFile in listOfPythonFiles
                    ])
                    epydocJob.setDataInput(xsd)
                    epydocJob.execute()
                else:
                    print("Error: No python files for plugin %s" % oneplugin)
    EDVerbose.screen("Back to main")
    for jobName in dictJobs:
        job = dictJobs[jobName]
        if job.getStatus() in [
                EDJob.PLUGIN_STATE_RUNNING, EDJob.PLUGIN_STATE_UNITIALIZED
        ]:
            EDVerbose.screen("Waiting for job %s to finish" % jobName)
            job.synchronize()
    EDVerbose.screen("Generation of documentation finished")
    os.chdir(cwd)
    EDJob.stats()