From 90eee6e2d1c6b831116859dc7a2ee0fab05f7fc7 Mon Sep 17 00:00:00 2001 From: Alexander Gordeyev Date: Sat, 19 Dec 2015 17:08:13 +0300 Subject: [PATCH] add disable close button example --- gooey/_tmp/example_disable_stop.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 gooey/_tmp/example_disable_stop.py diff --git a/gooey/_tmp/example_disable_stop.py b/gooey/_tmp/example_disable_stop.py new file mode 100644 index 0000000..b6c12e2 --- /dev/null +++ b/gooey/_tmp/example_disable_stop.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from __future__ import unicode_literals +from __future__ import print_function +import sys +from time import sleep +from gooey import Gooey, GooeyParser + + +@Gooey(progress_regex=r"^progress: (\d+)%$", + disable_stop_button=True) +def main(): + parser = GooeyParser(prog="example_progress_bar_1") + _ = parser.parse_args(sys.argv[1:]) + + for i in range(100): + print("progress: {}%".format(i+1)) + sys.stdout.flush() + sleep(0.1) + + +if __name__ == "__main__": + sys.exit(main())