Esempio n. 1
0
def clearCatalog(gui):
    """
    Clears all catalog data currently loaded.
    
    :param tkwidget gui: GUI object from which the request came
    """
    prt = gui.getPrtInstance()

    if (not ASTCatalog.isCatalogLoaded()):
        ASTMsg.errMsg(
            "No catalog is currently loaded, so there is nothing to clear.",
            "No Catalog Loaded")
        return

    prt.clearTextArea()

    if (ASTMsg.pleaseConfirm(
            "Are you sure you want to clear all\ncurrently loaded catalog data?",
            "Clear Catalog Data")):
        ASTCatalog.clearCatalogAndSpaceObjects()
        gui.setFilename("")
        gui.setCatalogType("")
        gui.setEpoch(DEFAULT_EPOCH)
        prt.println("All currently loaded catalog data was cleared ...")
    else:
        prt.println("Catalog data was not cleared ...")

    prt.resetCursor()
Esempio n. 2
0
def exitMenuListener():
    """Handle a click on the Exit menu item"""
    if ASTMsg.pleaseConfirm("Are you sure you want to exit?", " "):
        sys.exit()