예제 #1
0
파일: pyfa.py 프로젝트: thauser/Pyfa
                  help="Set the folder for savedata",
                  default=None)
parser.add_option(
    "-l",
    "--logginglevel",
    action="store",
    dest="logginglevel",
    help="Set desired logging level [Critical|Error|Warning|Info|Debug]",
    default="Error")

(options, args) = parser.parse_args()

if __name__ == "__main__":
    try:
        # first and foremost - check required libraries
        version_precheck()
    except PreCheckException as ex:
        # do not pass GO, go directly to jail (and then die =/)
        PreCheckMessage(str(ex))
        sys.exit()

    # from here, we can assume we have the libraries that we need, including wx
    import wx

    from logbook import Logger
    pyfalog = Logger(__name__)

    from gui.errorDialog import ErrorHandler

    # Replace the uncaught exception handler with our own handler.
    sys.excepthook = ErrorHandler.HandleException
예제 #2
0
파일: pyfa.py 프로젝트: Sectoid/Pyfa
usage = "usage: %prog [--root]"
parser = PassThroughOptionParser(usage=usage)
parser.add_option("-r", "--root", action="store_true", dest="rootsavedata", help="if you want pyfa to store its data in root folder, use this option", default=False)
parser.add_option("-d", "--debug", action="store_true", dest="debug", help="Set logger to debug level.", default=False)
parser.add_option("-t", "--title", action="store", dest="title", help="Set Window Title", default=None)
parser.add_option("-s", "--savepath", action="store", dest="savepath", help="Set the folder for savedata", default=None)
parser.add_option("-l", "--logginglevel", action="store", dest="logginglevel", help="Set desired logging level [Critical|Error|Warning|Info|Debug]", default="Error")
parser.add_option("-p", "--profile", action="store", dest="profile_path", help="Set location to save profileing.", default=None)

(options, args) = parser.parse_args()

if __name__ == "__main__":

    try:
        # first and foremost - check required libraries
        version_precheck()
    except PreCheckException as ex:
        # do not pass GO, go directly to jail (and then die =/)
        PreCheckMessage(str(ex))
        sys.exit()

    # from here, we can assume we have the libraries that we need, including wx
    import wx

    from logbook import Logger
    pyfalog = Logger(__name__)

    from gui.errorDialog import ErrorHandler

    # Replace the uncaught exception handler with our own handler.
    sys.excepthook = ErrorHandler.HandleException