def cleanup(): global retain ParSys.cleanup() if retain: msg_out( "Retaining temporary files in {0}".format(NDG.tempdir)) else: NDG.cleanup()
def cleanup(): try: os.remove( "config1.tmp" ) os.remove( "config2.tmp" ) ParSys.cleanup() except: pass
def cleanup(): global retain ParSys.cleanup() if retain: msg_out("Retaining temporary files in {0}".format(NDG.tempdir)) else: NDG.cleanup()
params = [] params.append(starutil.Par0S("CONFIG1", "The first config" )) params.append(starutil.Par0S("CONFIG2", "The second config" )) params.append(starutil.ParChoice("WAVEBAND", ("450","850"), "The waveband to display - 450 or 850", "850" )) params.append(starutil.Par0L("DEFAULTS", "Include defaults for missing " "values?", True, True )) params.append(starutil.Par0S("TOOL", "The file comparison tool to use", None, True )) params.append(starutil.Par0S("PARAM", "A single config parameter to display", None, True )) # Initialise the parameters to hold any values supplied on the command # line. parsys = ParSys( params ) # Are we displaying a single parameter? param = parsys["PARAM"].value # If not, get the comparison tool to use. if param is None: tool = parsys["TOOL"].value if tool is None: for trytool in ( "meld", "opendiff", "diffmerge", "kdiff3", "tkdiff", "diffuse" ): if starutil.which( trytool ) is not None: tool = trytool break if tool is None: print( "\n!! Could not find a usable file comparison tool") os._exit(1)