Пример #1
0
    ap.add_argument("-v",
                    "--version",
                    dest="version",
                    default=False,
                    action="store_true",
                    help="displays the current version of the application")

    return ap.parse_args()


if __name__ == "__main__":
    arguments = parse_args()

    if arguments.test:
        doctest.testmod()  # unit testing
        sys.exit()

    # displays version of the program
    if arguments.version:
        sys.exit("{} {}".format(APP_TITLE, VERSION_NUMBER))

    # creates the annotation engine
    annotator = Annotator()

    if arguments.fullscreen:
        annotator.toggle_fullscreen()  # toggles fullscreen

    annotator.parent.protocol("WM_DELETE_WINDOW",
                              annotator.exit_prompt)  # quit event handler
    annotator.mainloop()  # runs the main tkinter loop