def cancelFDist(): global empiricalPanel, systemPanel, statusPanel, frame global fda, fdt, isTemporal if not yesNo(frame, 'Are you sure you want to cancel (cancel will take a few seconds to complete)?'): return if isTemporal: fdt.acquire() fdt.report_fun = None fdt.release() fdt.stop() fd = fdt else: fda.acquire() fda.report_fun = None fda.release() fda.stop() fd = fda while len(fd.async.running) > 0: remaining = str(len(fd.async.running)) time.sleep(0.1)
def savePopNames(): global frame global popNames, remPops fc = JFileChooser(dataPath) retVal = fc.showSaveDialog(frame) if retVal == JFileChooser.APPROVE_OPTION: file = fc.getSelectedFile().getAbsolutePath() try: f = open(file) except IOError: exists = False else: exists = True f.close() if exists: if not yesNo(frame, "File exists, overwrite?"): return f = open(file, 'w') for popName in popNames: f.write(popName + '\n') f.close()