# Copyright 2016, 2017 Declan Hoare # This file is part of Merac-O-Matic. # # Merac-O-Matic is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Merac-O-Matic is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Merac-O-Matic. If not, see <http://www.gnu.org/licenses/>. # # This program allows the user to control Merac-O-Matic from a text # environment. import coremeraco, argparse, meracolocale localisationFile = meracolocale.getAndParseLocalisationFile() parser = argparse.ArgumentParser(description=meracolocale.getLocalisedString(localisationFile,"productDescription")) parser.add_argument('--exit', dest='exitStatement', action='store_const', const='exit', default='regular', help=meracolocale.getLocalisedString(localisationFile,"exitHelpText")) args = parser.parse_args() if args.exitStatement == 'exit': print(coremeraco.constructExitStatement()) else: print(coremeraco.constructRegularStatement())
def quitProgram(): tkMessageBox.showinfo(productName, coremeraco.constructExitStatement()) sys.exit() # Just running exit() doesn't work with PyInstaller