././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648817217.7610354 easygui-0.98.3/0000777000000000000000000000000000000000000010154 5ustar00././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/LICENSE0000666000000000000000000000275300000000000011170 0ustar00Copyright 2021 Easygui developers and Stephen Raymond Ferg Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648817194.0 easygui-0.98.3/MANIFEST.in0000666000000000000000000000002100000000000011703 0ustar00include README.md././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648817217.7610354 easygui-0.98.3/PKG-INFO0000666000000000000000000002060100000000000011250 0ustar00Metadata-Version: 2.1 Name: easygui Version: 0.98.3 Summary: EasyGUI is a module for very simple, very easy GUI programming in Python. EasyGUI is different from other GUI generators in that EasyGUI is NOT event-driven. Instead, all GUI interactions are invoked by simple function calls. Home-page: https://github.com/robertlugg/easygui Author: easygui developers and Stephen Ferg Author-email: robert.lugg@gmail.com License: BSD Keywords: gui linux windows graphical user interface Platform: UNKNOWN Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Education Classifier: License :: OSI Approved :: BSD License Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Topic :: Software Development :: User Interfaces Description-Content-Type: text/markdown License-File: LICENSE Project in Maintainance ======================= Hi everyone. There hasn't been much activity but thankfully we have a new revision. Thank you contributors and thank you Stephen Ferg for creating EasyGui. You might also consider the following alternatives: - https://github.com/aroberge/easygui_qt - https://github.com/ponty/psidialogs For those who wish to contribute you are welcome to fork this respository. Or, take a look at the alternatives and contribute there. Kind Regards, Robert EasyGUI ======= EasyGUI is a module for very simple, very easy GUI programming in Python. EasyGUI is different from other GUI libraries in that EasyGUI is NOT event-driven. Instead, all GUI interactions are invoked by simple function calls. EasyGUI runs on Python 2 and 3, and does not have any dependencies beyond python and Tk. Linux Python 2 users will have to run `sudo apt-get install python-tk` and Linux Python 3 users will have to run `sudo apt-get install python3-tk` to install Tkinter. Example Usage ------------- >>> import easygui >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) 1 >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') 'OK' >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) 'Chocolate' To see demo programs using EasyGUI, call the `easygui.egdemo()` function. Full documentation is always available. For the most-recent production version: . For our develop version which will be released next: . 0.98.3 ======================================================================== Update collections.abc import location (old location was deprecated since version 3.3, removed in version 3.10) See: https://docs.python.org/3.9/library/collections.html#module-collections for details Add some unit test coverage and test automation for TravisCI. 0.98.2 ======================================================================== Several updates and fixes thanks to Al and others. 0.98.0 ======================================================================== This is an exciting time for easygui. We continue to make good progress with refactoring as well as some enhancements and bug fixes here and there. We would like to welcome Juanjo Denis-Corrales to the team. He is responsible for lots of good new work this release. Of course we appreciate the work of everyone who contributed. NOTE: I decided in this release to change the API a bit. Please consult the function documentation for details. BUG FIXES --------- * Made changes guessing at fixes to any IDLE problems. Please report any problems found. ENHANCEMENTS ------------ * Refactored the easygui.py file into several smaller files to improve our ability to manage the code * Added callbacks to allow for more dynamic dialogs. See the docs for usage. * Added class access to dialogs so properties may be changed. KNOWN ISSUES ------------ * There were previous issues when using easygui with the IDLE IDE. I hope I resolved these problems, however, I've never actually been able to repeat them. Please report any problems found in github. OTHER CHANGES ------------- * Centralized the Python 2 versus Python 3 "compatibility layer" into boxes/utils.py 0.97.4 ======================================================================== This is a minor bug-fix release to address python 3 import errors. 0.97.3 ======================================================================== We are happy to release version 0.97.3 of easygui. The intent of this release is to address some basic functionality issues as well as improve easygui in the ways people have asked. Robert Lugg (me) was searching for a GUI library for my python work. I saw easygui and liked very much its paradigm. Stephen Ferg, the creator and developer of easygui, graciously allowed me to start development back up. With the help of Alexander Zawadzki, Horst Jens, and others I set a goal to release before the end of 2014. We rely on user feedback so please bring up problems, ideas, or just say how you are using easygui. BUG FIXES --------- * sourceforge #4: easygui docs contain bad references to easygui_pydoc.html * sourceforge #6: no index.html in docs download file. Updated to sphinx which as autolinking. * sourceforge #8: unicode issues with file*box. Fixed all that I knew how. * sourceforge #12: Cannot Exit with 'X'. Now X and escape either return "cancel_button", if set, or None ENHANCEMENTS ------------ * Added ability to specify default_choice and cancel_choice for button widgets (See API docs) * True and False are returned instead of 1 and 0 for several boxes * Allow user to map keyboard keys to buttons by enclosing a hotkey in square braces like: "Pick [M]e", which would assign keyboard key M to that button. Double braces hide that character, and keysyms are allowed: [[q]]Exit Would show Exit on the button, and the button would be controlled by the q key []Help Would show Help on the button, and the button would be controlled by the F1 function key NOTE: We are still working on the exact syntax of these key mappings as Enter, space, and arrows are already being used. * Escape and the windows 'X' button always work in buttonboxes. Those return None in that case. * sourceforge #9: let fileopenbox open multiple files. Added optional argument 'multiple' * Location of dialogs on screen is preserved. This isn't perfect yet, but now, at least, the dialogs don't always reset to their default position! * added some, but not all of the bugs/enhancements developed by Robbie Brook: http://all-you-need-is-tech.blogspot.com/2013/01/improving-easygui-for-python.html KNOWN ISSUES ------------ * In the documentation, there were previous references to issues when using the IDLE IDE. I haven't experienced those, but also didn't do anything to fix them, so they may still be there. Please report any problems and we'll try to address them * I am fairly new to contributing to open source, so I don't understand packaging, pypi, etc. There are likely problems as well as better ways to do things. Again, I appreciate any help or guidance. Other Changes (that you likely don't care about) ------------------------------------------------ * Restructured loading of image files to try PIL first throw error if file doesn't exist. * Converted docs to sphinx with just a bit of doctest. Most content was retained from the old site, so there might be some redundancies still. Please make any suggested improvements. * Set up a GitHub repository for development: https://github.com/robertlugg/easygui * Improved output/packaging for Debian distribution EasyGui is licensed under what is generally known as the "modified BSD license" (aka "revised BSD", "new BSD", "3-clause BSD"). This license is GPL-compatible but less restrictive than GPL. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648817194.0 easygui-0.98.3/README.md0000666000000000000000000001602700000000000011441 0ustar00Project in Maintainance ======================= Hi everyone. There hasn't been much activity but thankfully we have a new revision. Thank you contributors and thank you Stephen Ferg for creating EasyGui. You might also consider the following alternatives: - https://github.com/aroberge/easygui_qt - https://github.com/ponty/psidialogs For those who wish to contribute you are welcome to fork this respository. Or, take a look at the alternatives and contribute there. Kind Regards, Robert EasyGUI ======= EasyGUI is a module for very simple, very easy GUI programming in Python. EasyGUI is different from other GUI libraries in that EasyGUI is NOT event-driven. Instead, all GUI interactions are invoked by simple function calls. EasyGUI runs on Python 2 and 3, and does not have any dependencies beyond python and Tk. Linux Python 2 users will have to run `sudo apt-get install python-tk` and Linux Python 3 users will have to run `sudo apt-get install python3-tk` to install Tkinter. Example Usage ------------- >>> import easygui >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) 1 >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') 'OK' >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) 'Chocolate' To see demo programs using EasyGUI, call the `easygui.egdemo()` function. Full documentation is always available. For the most-recent production version: . For our develop version which will be released next: . 0.98.3 ======================================================================== Update collections.abc import location (old location was deprecated since version 3.3, removed in version 3.10) See: https://docs.python.org/3.9/library/collections.html#module-collections for details Add some unit test coverage and test automation for TravisCI. 0.98.2 ======================================================================== Several updates and fixes thanks to Al and others. 0.98.0 ======================================================================== This is an exciting time for easygui. We continue to make good progress with refactoring as well as some enhancements and bug fixes here and there. We would like to welcome Juanjo Denis-Corrales to the team. He is responsible for lots of good new work this release. Of course we appreciate the work of everyone who contributed. NOTE: I decided in this release to change the API a bit. Please consult the function documentation for details. BUG FIXES --------- * Made changes guessing at fixes to any IDLE problems. Please report any problems found. ENHANCEMENTS ------------ * Refactored the easygui.py file into several smaller files to improve our ability to manage the code * Added callbacks to allow for more dynamic dialogs. See the docs for usage. * Added class access to dialogs so properties may be changed. KNOWN ISSUES ------------ * There were previous issues when using easygui with the IDLE IDE. I hope I resolved these problems, however, I've never actually been able to repeat them. Please report any problems found in github. OTHER CHANGES ------------- * Centralized the Python 2 versus Python 3 "compatibility layer" into boxes/utils.py 0.97.4 ======================================================================== This is a minor bug-fix release to address python 3 import errors. 0.97.3 ======================================================================== We are happy to release version 0.97.3 of easygui. The intent of this release is to address some basic functionality issues as well as improve easygui in the ways people have asked. Robert Lugg (me) was searching for a GUI library for my python work. I saw easygui and liked very much its paradigm. Stephen Ferg, the creator and developer of easygui, graciously allowed me to start development back up. With the help of Alexander Zawadzki, Horst Jens, and others I set a goal to release before the end of 2014. We rely on user feedback so please bring up problems, ideas, or just say how you are using easygui. BUG FIXES --------- * sourceforge #4: easygui docs contain bad references to easygui_pydoc.html * sourceforge #6: no index.html in docs download file. Updated to sphinx which as autolinking. * sourceforge #8: unicode issues with file*box. Fixed all that I knew how. * sourceforge #12: Cannot Exit with 'X'. Now X and escape either return "cancel_button", if set, or None ENHANCEMENTS ------------ * Added ability to specify default_choice and cancel_choice for button widgets (See API docs) * True and False are returned instead of 1 and 0 for several boxes * Allow user to map keyboard keys to buttons by enclosing a hotkey in square braces like: "Pick [M]e", which would assign keyboard key M to that button. Double braces hide that character, and keysyms are allowed: [[q]]Exit Would show Exit on the button, and the button would be controlled by the q key []Help Would show Help on the button, and the button would be controlled by the F1 function key NOTE: We are still working on the exact syntax of these key mappings as Enter, space, and arrows are already being used. * Escape and the windows 'X' button always work in buttonboxes. Those return None in that case. * sourceforge #9: let fileopenbox open multiple files. Added optional argument 'multiple' * Location of dialogs on screen is preserved. This isn't perfect yet, but now, at least, the dialogs don't always reset to their default position! * added some, but not all of the bugs/enhancements developed by Robbie Brook: http://all-you-need-is-tech.blogspot.com/2013/01/improving-easygui-for-python.html KNOWN ISSUES ------------ * In the documentation, there were previous references to issues when using the IDLE IDE. I haven't experienced those, but also didn't do anything to fix them, so they may still be there. Please report any problems and we'll try to address them * I am fairly new to contributing to open source, so I don't understand packaging, pypi, etc. There are likely problems as well as better ways to do things. Again, I appreciate any help or guidance. Other Changes (that you likely don't care about) ------------------------------------------------ * Restructured loading of image files to try PIL first throw error if file doesn't exist. * Converted docs to sphinx with just a bit of doctest. Most content was retained from the old site, so there might be some redundancies still. Please make any suggested improvements. * Set up a GitHub repository for development: https://github.com/robertlugg/easygui * Improved output/packaging for Debian distribution EasyGui is licensed under what is generally known as the "modified BSD license" (aka "revised BSD", "new BSD", "3-clause BSD"). This license is GPL-compatible but less restrictive than GPL. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/README.txt0000666000000000000000000001404500000000000011656 0ustar00EasyGUI ======= EasyGUI is a module for very simple, very easy GUI programming in Python. EasyGUI is different from other GUI libraries in that EasyGUI is NOT event-driven. Instead, all GUI interactions are invoked by simple function calls. EasyGUI runs on Python 2 and 3, and does not have any dependencies beyond python and Tk. Example Usage ------------- >>> import easygui >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) 1 >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') 'OK' >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) 'Chocolate' Full documentation is always available. For the most-recent production version: . For our develop version which will be released next: . 0.98.2 ======================================================================== Several updates and fixes thanks to Al and others. 0.98.0 ======================================================================== This is an exciting time for easygui. We continue to make good progress with refactoring as well as some enhancements and bug fixes here and there. We would like to welcome Juanjo Denis-Corrales to the team. He is responsible for lots of good new work this release. Of course we appreciate the work of everyone who contributed. NOTE: I decided in this release to change the API a bit. Please consult the function documentation for details. BUG FIXES --------- * Made changes guessing at fixes to any IDLE problems. Please report any problems found. ENHANCEMENTS ------------ * Refactored the easygui.py file into several smaller files to improve our ability to manage the code * Added callbacks to allow for more dynamic dialogs. See the docs for usage. * Added class access to dialogs so properties may be changed. * in integerbox, allowed lower and upper bounds to be None which means they aren't checked. KNOWN ISSUES ------------ * There were previous issues when using easygui with the IDLE IDE. I hope I resolved these problems, however, I've never actually been able to repeat them. Please report any problems found in github. OTHER CHANGES ------------- * Centralized the Python 2 versus Python 3 "compatibility layer" into boxes/utils.py 0.97.4 ======================================================================== This is a minor bug-fix release to address python 3 import errors. 0.97.3 ======================================================================== We are happy to release version 0.97.3 of easygui. The intent of this release is to address some basic functionality issues as well as improve easygui in the ways people have asked. Robert Lugg (me) was searching for a GUI library for my python work. I saw easygui and liked very much its paradigm. Stephen Ferg, the creator and developer of easygui, graciously allowed me to start development back up. With the help of Alexander Zawadzki, Horst Jens, and others I set a goal to release before the end of 2014. We rely on user feedback so please bring up problems, ideas, or just say how you are using easygui. BUG FIXES --------- * sourceforge #4: easygui docs contain bad references to easygui_pydoc.html * sourceforge #6: no index.html in docs download file. Updated to sphinx which as autolinking. * sourceforge #8: unicode issues with file*box. Fixed all that I knew how. * sourceforge #12: Cannot Exit with 'X'. Now X and escape either return "cancel_button", if set, or None ENHANCEMENTS ------------ * Added ability to specify default_choice and cancel_choice for button widgets (See API docs) * True and False are returned instead of 1 and 0 for several boxes * Allow user to map keyboard keys to buttons by enclosing a hotkey in square braces like: "Pick [M]e", which would assign keyboard key M to that button. Double braces hide that character, and keysyms are allowed: [[q]]Exit Would show Exit on the button, and the button would be controlled by the q key []Help Would show Help on the button, and the button would be controlled by the F1 function key NOTE: We are still working on the exact syntax of these key mappings as Enter, space, and arrows are already being used. * Escape and the windows 'X' button always work in buttonboxes. Those return None in that case. * sourceforge #9: let fileopenbox open multiple files. Added optional argument 'multiple' * Location of dialogs on screen is preserved. This isn't perfect yet, but now, at least, the dialogs don't always reset to their default position! * added some, but not all of the bugs/enhancements developed by Robbie Brook: http://all-you-need-is-tech.blogspot.com/2013/01/improving-easygui-for-python.html KNOWN ISSUES ------------ * In the documentation, there were previous references to issues when using the IDLE IDE. I haven't experienced those, but also didn't do anything to fix them, so they may still be there. Please report any problems and we'll try to address them * I am fairly new to contributing to open source, so I don't understand packaging, pypi, etc. There are likely problems as well as better ways to do things. Again, I appreciate any help or guidance. Other Changes (that you likely don't care about) ------------------------------------------------ * Restructured loading of image files to try PIL first throw error if file doesn't exist. * Converted docs to sphinx with just a bit of doctest. Most content was retained from the old site, so there might be some redundancies still. Please make any suggested improvements. * Set up a GitHub repository for development: https://github.com/robertlugg/easygui * Improved output/packaging for Debian distribution EasyGui is licensed under what is generally known as the "modified BSD license" (aka "revised BSD", "new BSD", "3-clause BSD"). This license is GPL-compatible but less restrictive than GPL. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648817217.7141874 easygui-0.98.3/easygui/0000777000000000000000000000000000000000000011622 5ustar00././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648571827.0 easygui-0.98.3/easygui/__init__.py0000666000000000000000000000337500000000000013743 0ustar00""" Hello from easygui/__init__.py """ # __all__ must be defined in order for Sphinx to generate the API automatically. __all__ = ['buttonbox', 'diropenbox', 'fileopenbox', 'filesavebox', 'textbox', 'ynbox', 'ccbox', 'boolbox', 'indexbox', 'msgbox', 'integerbox', 'multenterbox', 'enterbox', 'exceptionbox', 'choicebox', 'codebox', 'passwordbox', 'multpasswordbox', 'multchoicebox', 'EgStore', 'eg_version', 'egversion', 'abouteasygui', 'egdemo', ] # Import all functions that form the API from .boxes.button_box import buttonbox from .boxes.diropen_box import diropenbox from .boxes.fileopen_box import fileopenbox from .boxes.filesave_box import filesavebox from .boxes.text_box import textbox from .boxes.derived_boxes import ynbox from .boxes.derived_boxes import ccbox from .boxes.derived_boxes import boolbox from .boxes.derived_boxes import indexbox from .boxes.derived_boxes import msgbox from .boxes.derived_boxes import integerbox from .boxes.multi_fillable_box import multenterbox from .boxes.derived_boxes import enterbox from .boxes.derived_boxes import exceptionbox from .boxes.choice_box import choicebox from .boxes.derived_boxes import codebox from .boxes.derived_boxes import passwordbox from .boxes.multi_fillable_box import multpasswordbox from .boxes.choice_box import multchoicebox from .boxes.egstore import EgStore, read_or_create_settings from .boxes.about import eg_version, egversion, abouteasygui from .boxes.demo import easygui_demo as egdemo ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/__main__.py0000666000000000000000000000006400000000000013714 0ustar00from .boxes.demo import easygui_demo easygui_demo()././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648817217.7610354 easygui-0.98.3/easygui/boxes/0000777000000000000000000000000000000000000012742 5ustar00././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/boxes/__init__.py0000666000000000000000000000000000000000000015041 0ustar00././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648571507.0 easygui-0.98.3/easygui/boxes/about.py0000666000000000000000000002740500000000000014436 0ustar00""" .. moduleauthor:: easygui developers and Stephen Raymond Ferg .. default-domain:: py .. highlight:: python """ try: from .derived_boxes import codebox except (SystemError, ValueError, ImportError): from derived_boxes import codebox eg_version = '0.98.2-RELEASED' egversion = eg_version def abouteasygui(): """ Shows the EasyGUI revision history. """ codebox("About EasyGui\n{}".format(eg_version), "EasyGui", EASYGUI_ABOUT_INFORMATION) return None EASYGUI_ABOUT_INFORMATION = ''' 0.98.2 ======================================================================== Several updates and fixes thanks to Al and others. 0.98.0 ======================================================================== This is an exciting time for easygui. We continue to make good progress with refactoring as well as some enhancements and bug fixes here and there. We would like to welcome Juanjo Corrales to the team. He is responsible for lots of good new work this release. Of course we appreciate the work of everyone who contributed. NOTE: I decided in this release to change the API a bit. Please consult the function documentation for details. BUG FIXES --------- * Made changes guessing at fixes to any IDLE problems. Please report any problems found. ENHANCEMENTS ------------ * Refactored the easygui.py file into several smaller files to improve our ability to manage the code * Added callbacks to allow for more dynamic dialogs. See the docs for usage. * Added class access to dialogs so properties may be changed. * Improved button boxes ability to resize during window resize by converting to Tkinter grid from packer. KNOWN ISSUES ------------ * (old) In the documentation, there were previous references to issues when using the IDLE IDE. I haven't experienced those, but also didn't do anything to fix them, so they may still be there. Please report any problems and we'll try to address them OTHER CHANGES ------------- * Centralized the Python 2 versus Python 3 "compatibility layer" into boxes/utils.py ======================================================================== 0.97.4 ======================================================================== This is a minor bug-fix release to address python 3 import errors. ======================================================================== 0.97.3 ======================================================================== Some more fixes especially to fix Debian distro problems. ======================================================================== 0.97.1 & 0.97.2 (2014-12-24) ======================================================================== Boring, embarrassing uploads to fix pypi install problems. ======================================================================== 0.97(2014-12-20) ======================================================================== We are happy to release version 0.97 of easygui. The intent of this release is to address some basic functionality issues as well as improve easygui in the ways people have asked. Robert Lugg (me) was searching for a GUI library for my python work. I saw easygui and liked very much its paradigm. Stephen Ferg, the creator and developer of easygui, graciously allowed me to start development back up. With the help of Alexander Zawadzki, Horst Jens, and others I set a goal to release before the end of 2014. We rely on user feedback so please bring up problems, ideas, or just say how you are using easygui. BUG FIXES --------- * sourceforge #4: easygui docs contain bad references to easygui_pydoc.html * sourceforge #6: no index.html in docs download file. Updated to sphinx which as autolinking. * sourceforge #8: unicode issues with file*box. Fixed all that I knew how. * sourceforge #12: Cannot Exit with 'X'. Now X and escape either return "cancel_button", if set, or None ENHANCEMENTS ------------ * Added ability to specify default_choice and cancel_choice for button widgets (See API docs) * True and False are returned instead of 1 and 0 for several boxes * Allow user to map keyboard keys to buttons by enclosing a hotkey in square braces like: "Pick [M]e", which would assign keyboard key M to that button. Double braces hide that character, and keysyms are allowed: [[q]]Exit Would show Exit on the button, and the button would be controlled by the q key []Help Would show Help on the button, and the button would be controlled by the F1 function key NOTE: We are still working on the exact syntax of these key mappings as Enter, space, and arrows are already being used. * Escape and the windows 'X' button always work in buttonboxes. Those return None in that case. * sourceforge #9: let fileopenbox open multiple files. Added optional argument 'multiple' * Location of dialogs on screen is preserved. This isn't perfect yet, but now, at least, the dialogs don't always reset to their default position! * added some, but not all of the bugs/enhancements developed by Robbie Brook: http://all-you-need-is-tech.blogspot.com/2013/01/improving-easygui-for-python.html KNOWN ISSUES ------------ * In the documentation, there were previous references to issues when using the IDLE IDE. I haven't experienced those, but also didn't do anything to fix them, so they may still be there. Please report any problems and we'll try to address them * I am fairly new to contributing to open source, so I don't understand packaging, pypi, etc. There are likely problems as well as better ways to do things. Again, I appreciate any help or guidance. Other Changes (that you likely don't care about) ------------------------------------------------ * Restructured loading of image files to try PIL first throw error if file doesn't exiglobal_state. * Converted docs to sphinx with just a bit of docteglobal_state. Most content was retained from the old site, so there might be some redundancies still. Please make any suggested improvements. * Set up a GitHub repository for development: https://github.com/robertlugg/easygui EasyGui is licensed under what is generally known as the "modified BSD license" (aka "revised BSD", "new BSD", "3-clause BSD"). This license is GPL-compatible but less restrictive than GPL. ======================================================================== 0.96(2010-08-29) ======================================================================== This version fixes some problems with version independence. BUG FIXES ------------------------------------------------------ * A statement with Python 2.x-style exception-handling syntax raised a syntax error when running under Python 3.x. Thanks to David Williams for reporting this problem. * Under some circumstances, PIL was unable to display non-gif images that it should have been able to display. The cause appears to be non-version-independent import syntax. PIL modules are now imported with a version-independent syntax. Thanks to Horst Jens for reporting this problem. LICENSE CHANGE ------------------------------------------------------ Starting with this version, EasyGui is licensed under what is generally known as the "modified BSD license" (aka "revised BSD", "new BSD", "3-clause BSD"). This license is GPL-compatible but less restrictive than GPL. Earlier versions were licensed under the Creative Commons Attribution License 2.0. ======================================================================== 0.95(2010-06-12) ======================================================================== ENHANCEMENTS ------------------------------------------------------ * Previous versions of EasyGui could display only .gif image files using the msgbox "image" argument. This version can now display all image-file formats supported by PIL the Python Imaging Library) if PIL is installed. If msgbox is asked to open a non-gif image file, it attempts to import PIL and to use PIL to convert the image file to a displayable format. If PIL cannot be imported (probably because PIL is not installed) EasyGui displays an error message saying that PIL must be installed in order to display the image file. Note that http://www.pythonware.com/products/pil/ says that PIL doesn't yet support Python 3.x. ======================================================================== 0.94(2010-06-06) ======================================================================== ENHANCEMENTS ------------------------------------------------------ * The codebox and textbox functions now return the contents of the box, rather than simply the name of the button ("Yes"). This makes it possible to use codebox and textbox as data-entry widgets. A big "thank you!" to Dominic Comtois for requesting this feature, patiently explaining his requirement, and helping to discover the tkinter techniques to implement it. NOTE THAT in theory this change breaks backward compatibility. But because (in previous versions of EasyGui) the value returned by codebox and textbox was meaningless, no application should have been checking it. So in actual practice, this change should not break backward compatibility. * Added support for SPACEBAR to command buttons. Now, when keyboard focus is on a command button, a press of the SPACEBAR will act like a press of the ENTER key; it will activate the command button. * Added support for keyboard navigation with the arrow keys (up,down,left,right) to the fields and buttons in enterbox, multenterbox and multpasswordbox, and to the buttons in choicebox and all buttonboxes. * added highlightthickness=2 to entry fields in multenterbox and multpasswordbox. Now it is easier to tell which entry field has keyboard focus. BUG FIXES ------------------------------------------------------ * In EgStore, the pickle file is now opened with "rb" and "wb" rather than with "r" and "w". This change is necessary for compatibility with Python 3+. Thanks to Marshall Mattingly for reporting this problem and providing the fix. * In integerbox, the actual argument names did not match the names described in the docstring. Thanks to Daniel Zingaro of at University of Toronto for reporting this problem. * In integerbox, the "argLowerBound" and "argUpperBound" arguments have been renamed to "lowerbound" and "upperbound" and the docstring has been corrected. NOTE THAT THIS CHANGE TO THE ARGUMENT-NAMES BREAKS BACKWARD COMPATIBILITY. If argLowerBound or argUpperBound are used, an AssertionError with an explanatory error message is raised. * In choicebox, the signature to choicebox incorrectly showed choicebox as accepting a "buttons" argument. The signature has been fixed. ======================================================================== 0.93(2009-07-07) ======================================================================== ENHANCEMENTS ------------------------------------------------------ * Added exceptionbox to display stack trace of exceptions * modified names of some font-related constants to make it easier to customize them ======================================================================== 0.92(2009-06-22) ======================================================================== ENHANCEMENTS ------------------------------------------------------ * Added EgStore class to to provide basic easy-to-use persistence. BUG FIXES ------------------------------------------------------ * Fixed a bug that was preventing Linux users from copying text out of a textbox and a codebox. This was not a problem for Windows users. ''' if __name__ == '__main__': abouteasygui() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/boxes/base_boxes.py0000666000000000000000000000072600000000000015433 0ustar00""" .. moduleauthor:: easygui developers and Stephen Raymond Ferg .. default-domain:: py .. highlight:: python Version |release| """ boxRoot = None def bindArrows(widget): widget.bind("", tabRight) widget.bind("", tabLeft) widget.bind("", tabRight) widget.bind("", tabLeft) def tabRight(event): boxRoot.event_generate("") def tabLeft(event): boxRoot.event_generate("") ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/boxes/button_box.py0000666000000000000000000004327500000000000015512 0ustar00""" .. moduleauthor:: easygui developers and Stephen Raymond Ferg .. default-domain:: py .. highlight:: python Version |release| """ import os import re try: from . import global_state from . import utils as ut from .text_box import textbox except (SystemError, ValueError, ImportError): import global_state import utils as ut from text_box import textbox try: import tkinter as tk # python 3 import tkinter.font as tk_Font except (SystemError, ValueError, ImportError): import Tkinter as tk # python 2 import tkFont as tk_Font def demo_buttonbox_1(): print("hello from the demo") value = buttonbox( title="First demo", msg="bonjour", choices=["Button[1]", "Button[2]", "Button[3]"], default_choice="Button[2]") print("Return: {}".format(value)) def demo_buttonbox_2(): package_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) ;# My parent's directory images = list() images.append(os.path.join(package_dir, "python_and_check_logo.gif")) images.append(os.path.join(package_dir, "zzzzz.gif")) images.append(os.path.join(package_dir, "python_and_check_logo.png")) images = [images, images, images, images, ] value = buttonbox( title="Second demo", msg="Now is a good time to press buttons and show images", choices=['ok', 'cancel'], images=images) print("Return: {}".format(value)) # REF: http://stackoverflow.com/questions/1835018/python-check-if-an-object-is-a-list-or-tuple-but-not-string def is_sequence(arg): return hasattr(arg, "__getitem__") or hasattr(arg, "__iter__") def is_string(arg): ret_val = None try: ret_val = isinstance(arg, basestring) #Python 2 except: ret_val = isinstance(arg, str) #Python 3 return ret_val def buttonbox(msg="", title=" ", choices=("Button[1]", "Button[2]", "Button[3]"), image=None, images=None, default_choice=None, cancel_choice=None, callback=None, run=True): """ Display a message, a title, an image, and a set of buttons. The buttons are defined by the members of the choices argument. :param str msg: the msg to be displayed :param str title: the window title :param list choices: a list or tuple of the choices to be displayed :param str image: (Only here for backward compatibility) :param str images: Filename of image or iterable or iteratable of iterable to display :param str default_choice: The choice you want highlighted when the gui appears :return: the text of the button that the user selected """ if image and images: raise ValueError("Specify 'images' parameter only for buttonbox.") if image: images = image bb = ButtonBox( msg=msg, title=title, choices=choices, images=images, default_choice=default_choice, cancel_choice=cancel_choice, callback=callback) if not run: return bb else: reply = bb.run() return reply class ButtonBox(object): """ Display various types of button boxes This object separates user from ui, defines which methods can the user invoke and which properties can he change. It also calls the ui in defined ways, so if other gui library can be used (wx, qt) without breaking anything for the user. """ def __init__(self, msg, title, choices, images, default_choice, cancel_choice, callback): """ Create box object Parameters ---------- msg : string text displayed in the message area (instructions...) title : str the window title choices : iterable of strings build a button for each string in choices images : iterable of filenames, or an iterable of iterables of filenames displays each image default_choice : string one of the strings in choices to be the default selection cancel_choice : string if X or is pressed, it appears as if this button was pressed. callback: function if set, this function will be called when any button is pressed. Returns ------- object The box object """ self.callback = callback self.ui = GUItk(msg, title, choices, images, default_choice, cancel_choice, self.callback_ui) def run(self): """ Start the ui """ self.ui.run() ret_val = self._text self.ui = None return ret_val def stop(self): """ Stop the ui """ self.ui.stop() def callback_ui(self, ui, command): """ This method is executed when buttons or x is pressed in the ui. """ if command == 'update': # Any button was pressed self._text = ui.choice self._choice_rc = ui.choice_rc if self.callback: # If a callback was set, call main process self.callback(self) else: self.stop() elif command == 'x': self.stop() self._text = None elif command == 'cancel': self.stop() self._text = None # methods to change properties -------------- @property def msg(self): """Text in msg Area""" return self._msg @msg.setter def msg(self, msg): self._msg = self.to_string(msg) self.ui.set_msg(self._msg) @msg.deleter def msg(self): self._msg = "" self.ui.set_msg(self._msg) @property def choice(self): """ Name of button selected """ return self._text @property def choice_rc(self): """ The row/column of the selected button (as a tuple) """ return self._choice_rc # Methods to validate what will be sent to ui --------- def to_string(self, something): try: basestring # python 2 except NameError: basestring = str # Python 3 if isinstance(something, basestring): return something try: text = "".join(something) # convert a list or a tuple to a string except: textbox( "Exception when trying to convert {} to text in self.textArea" .format(type(something))) sys.exit(16) return text class GUItk(object): """ This is the object that contains the tk root object""" def __init__(self, msg, title, choices, images, default_choice, cancel_choice, callback): """ Create ui object Parameters ---------- msg : string text displayed in the message area (instructions...) title : str the window title choices : iterable of strings build a button for each string in choices images : iterable of filenames, or an iterable of iterables of filenames displays each image default_choice : string one of the strings in choices to be the default selection cancel_choice : string if X or is pressed, it appears as if this button was pressed. callback: function if set, this function will be called when any button is pressed. Returns ------- object The ui object """ self._title = title self._msg = msg self._choices = choices self._default_choice = default_choice self._cancel_choice = cancel_choice self.callback = callback self._choice_text = None self._choice_rc = None self._images = list() self.boxRoot = tk.Tk() # self.boxFont = tk_Font.Font( # family=global_state.PROPORTIONAL_FONT_FAMILY, # size=global_state.PROPORTIONAL_FONT_SIZE) self.boxFont = tk_Font.nametofont("TkFixedFont") self.width_in_chars = global_state.fixw_font_line_length # default_font.configure(size=global_state.PROPORTIONAL_FONT_SIZE) self.configure_root(title) self.create_msg_widget(msg) self.create_images_frame() self.create_images(images) self.create_buttons_frame() self.create_buttons(choices, default_choice) @property def choice(self): return self._choice_text @property def choice_rc(self): return self._choice_rc # Run and stop methods --------------------------------------- def run(self): self.boxRoot.mainloop() self.boxRoot.destroy() def stop(self): # Get the current position before quitting #self.get_pos() self.boxRoot.quit() # Methods to change content --------------------------------------- def set_msg(self, msg): self.messageArea.config(state=tk.NORMAL) self.messageArea.delete(1.0, tk.END) self.messageArea.insert(tk.END, msg) self.messageArea.config(state=tk.DISABLED) # Adjust msg height self.messageArea.update() self.set_msg_height() self.messageArea.update() def set_msg_height(self): message_content = self.messageArea.get("1.0", tk.END) lines = message_content.split("\n") width = self.messageArea["width"] num_lines = len(lines) num_wordwraps = sum(len(line) // width for line in lines if len(line) != width) height = num_lines + num_wordwraps + 1 self.messageArea.configure(height=height) def set_pos(self, pos): self.boxRoot.geometry(pos) def get_pos(self): # The geometry() method sets a size for the window and positions it on # the screen. The first two parameters are width and height of # the window. The last two parameters are x and y screen coordinates. # geometry("250x150+300+300") geom = self.boxRoot.geometry() # "628x672+300+200" global_state.window_position = '+' + geom.split('+', 1)[1] # Methods executing when a key is pressed ------------------------------- def x_pressed(self): self._choice_text = self._cancel_choice self.callback(self, command='x') def cancel_pressed(self, event): self._choice_text = self._cancel_choice self.callback(self, command='cancel') def button_pressed(self, button_text, button_rc): self._choice_text = button_text self._choice_rc = button_rc self.callback(self, command='update') def hotkey_pressed(self, event=None): """ Handle an event that is generated by a person interacting with a button. It may be a button press or a key press. TODO: Enhancement: Allow hotkey to be specified in filename of image as a shortcut too!!! """ # Determine window location and save to global # TODO: Not sure where this goes, but move it out of here! m = re.match(r"(\d+)x(\d+)([-+]\d+)([-+]\d+)", self.boxRoot.geometry()) if not m: raise ValueError( "failed to parse geometry string: {}".format(self.boxRoot.geometry())) width, height, xoffset, yoffset = [int(s) for s in m.groups()] global_state.window_position = '{0:+g}{1:+g}'.format(xoffset, yoffset) # Hotkeys if self._buttons: for button_name, button in self._buttons.items(): hotkey_pressed = event.keysym if event.keysym != event.char: # A special character hotkey_pressed = '<{}>'.format(event.keysym) if button['hotkey'] == hotkey_pressed: self._choice_text = button_name self.callback(self, command='update') return print("Event not understood") # Auxiliary methods ----------------------------------------------- def calc_character_width(self): char_width = self.boxFont.measure('W') return char_width # Initial configuration methods --------------------------------------- # These ones are just called once, at setting. def configure_root(self, title): self.boxRoot.title(title) self.set_pos(global_state.window_position) # Resize setup self.boxRoot.columnconfigure(0, weight=10) self.boxRoot.minsize(100, 200) # Quit when x button pressed self.boxRoot.protocol('WM_DELETE_WINDOW', self.x_pressed) self.boxRoot.bind("", self.cancel_pressed) self.boxRoot.iconname('Dialog') self.boxRoot.attributes("-topmost", True) # Put the dialog box in focus. def create_msg_widget(self, msg): if msg is None: msg = "" self.messageArea = tk.Text( self.boxRoot, width=self.width_in_chars, state=tk.DISABLED, padx=(global_state.default_hpad_in_chars) * self.calc_character_width(), relief="flat", background=self.boxRoot.config()["background"][-1], pady=global_state.default_hpad_in_chars * self.calc_character_width(), wrap=tk.WORD, ) self.set_msg(msg) self.messageArea.grid(row=0) self.boxRoot.rowconfigure(0, weight=10, minsize='10m') def create_images_frame(self): self.imagesFrame = tk.Frame(self.boxRoot) row = 1 self.imagesFrame.grid(row=row) self.boxRoot.rowconfigure(row, weight=10, minsize='10m') def create_images(self, filenames): """ Create one or more images in the dialog. :param filenames: May be a filename (which will generate a single image), a list of filenames (which will generate a row of images), or a list of list of filename (which will create a 2D array of buttons. :return: """ if filenames is None: return # Convert to a list of lists of filenames regardless of input if is_string(filenames): filenames = [[filenames,],] elif is_sequence(filenames) and is_string(filenames[0]): filenames = [filenames,] elif is_sequence(filenames) and is_sequence(filenames[0]) and is_string(filenames[0][0]): pass else: raise ValueError("Incorrect images argument.") images = list() for _r, images_row in enumerate(filenames): row_number = len(filenames) - _r for column_number, filename in enumerate(images_row): this_image = dict() try: this_image['tk_image'] = ut.load_tk_image(filename) except Exception as e: print(e) this_image['tk_image'] = None this_image['widget'] = tk.Button( self.imagesFrame, takefocus=1, compound=tk.TOP) if this_image['widget'] is not None: this_image['widget'].configure(image=this_image['tk_image']) fn = lambda text=filename, row=_r, column=column_number: self.button_pressed(text, (row, column)) this_image['widget'].configure(command=fn) sticky_dir = tk.N+tk.S+tk.E+tk.W this_image['widget'].grid(row=row_number, column=column_number, sticky=sticky_dir, padx='1m', pady='1m', ipadx='2m', ipady='1m') self.imagesFrame.rowconfigure(row_number, weight=10, minsize='10m') self.imagesFrame.columnconfigure(column_number, weight=10) images.append(this_image) self._images = images # Image objects must live, so place them in self. Otherwise, they will be deleted. def create_buttons_frame(self): self.buttonsFrame = tk.Frame(self.boxRoot) self.buttonsFrame.grid(row=2, column=0) def create_buttons(self, choices, default_choice): unique_choices = ut.uniquify_list_of_strings(choices) # Create buttons dictionary and Tkinter widgets buttons = dict() i_hack = 0 for row, (button_text, unique_button_text) in enumerate(zip(choices, unique_choices)): this_button = dict() this_button['original_text'] = button_text this_button['clean_text'], this_button['hotkey'], hotkey_position = ut.parse_hotkey(button_text) this_button['widget'] = tk.Button( self.buttonsFrame, takefocus=1, text=this_button['clean_text'], underline=hotkey_position) fn = lambda text=button_text, row=row, column=0: self.button_pressed(text, (row, column)) this_button['widget'].configure(command=fn) this_button['widget'].grid(row=0, column=i_hack, padx='1m', pady='1m', ipadx='2m', ipady='1m') self.buttonsFrame.columnconfigure(i_hack, weight=10) i_hack += 1 buttons[unique_button_text] = this_button self._buttons = buttons if default_choice in buttons: buttons[default_choice]['widget'].focus_force() # Bind hotkeys for hk in [button['hotkey'] for button in buttons.values() if button['hotkey']]: self.boxRoot.bind_all(hk, lambda e: self.hotkey_pressed(e), add=True) if __name__ == '__main__': demo_buttonbox_1() demo_buttonbox_2()././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648814214.0 easygui-0.98.3/easygui/boxes/choice_box.py0000666000000000000000000004577100000000000015434 0ustar00import string import sys if sys.version_info < (3, 10): from collections import Sequence else: from collections.abc import Sequence try: from . import global_state from .base_boxes import bindArrows except (SystemError, ValueError, ImportError): import global_state from base_boxes import bindArrows try: import tkinter as tk # python 3 import tkinter.font as tk_Font except: import Tkinter as tk # python 2 import tkFont as tk_Font def choicebox(msg="Pick an item", title="", choices=None, preselect=0, callback=None, run=True): """ The ``choicebox()`` provides a list of choices in a list box to choose from. The choices are specified in a sequence (a tuple or a list). import easygui msg ="What is your favorite flavor?" title = "Ice Cream Survey" choices = ["Vanilla", "Chocolate", "Strawberry", "Rocky Road"] choice = easygui.choicebox(msg, title, choices) # choice is a string :param str msg: the msg to be displayed :param str title: the window title :param list choices: a list or tuple of the choices to be displayed :param preselect: Which item, if any are preselected when dialog appears :return: A string of the selected choice or None if cancelled """ mb = ChoiceBox(msg, title, choices, preselect=preselect, multiple_select=False, callback=callback) if run: reply = mb.run() return reply else: return mb def multchoicebox(msg="Pick an item", title="", choices=None, preselect=0, callback=None, run=True): """ The ``multchoicebox()`` function provides a way for a user to select from a list of choices. The interface looks just like the ``choicebox()`` function's dialog box, but the user may select zero, one, or multiple choices. The choices are specified in a sequence (a tuple or a list). import easygui msg ="What is your favorite flavor?" title = "Ice Cream Survey" choices = ["Vanilla", "Chocolate", "Strawberry", "Rocky Road"] choice = easygui.multchoicebox(msg, title, choices) :param str msg: the msg to be displayed :param str title: the window title :param list choices: a list or tuple of the choices to be displayed :param preselect: Which item, if any are preselected when dialog appears :return: A list of strings of the selected choices or None if cancelled. """ mb = ChoiceBox(msg, title, choices, preselect=preselect, multiple_select=True, callback=callback) if run: reply = mb.run() return reply else: return mb # Utility function. But, is it generic enough to be moved out of here? def make_list_or_none(obj, cast_type=None): # ------------------------------------------------------------------- # for an object passed in, put it in standardized form. # It may be None. Just return None # If it is a scalar, attempt to cast it into cast_type. Raise error # if not possible. Convert scalar to a single-element list. # If it is a collections.Sequence (including a scalar converted to let), # then cast each element to cast_type. Raise error if any cannot be converted. # ------------------------------------------------------------------- ret_val = obj if ret_val is None: return None # Convert any non-sequence to single-element list if not isinstance(obj, Sequence): if cast_type is not None: try: ret_val = cast_type(obj) except Exception as e: raise Exception("Value {} cannot be converted to type: {}".format(obj, cast_type)) ret_val = [ret_val,] # Convert all elements to cast_type if cast_type is not None: try: ret_val = [cast_type(elem) for elem in ret_val] except: raise Exception("Not all values in {}\n can be converted to type: {}".format(ret_val, cast_type)) return ret_val class ChoiceBox(object): def __init__(self, msg, title, choices, preselect, multiple_select, callback): self.callback = callback if choices is None: # Use default choice selections if none were specified: choices = ('Choice 1', 'Choice 2') self.choices = self.to_list_of_str(choices) # Convert preselect to always be a list or None. preselect_list = make_list_or_none(preselect, cast_type=int) if not multiple_select and len(preselect_list)>1: raise ValueError("Multiple selections not allowed, yet preselect has multiple values:{}".format(preselect_list)) self.ui = GUItk(msg, title, self.choices, preselect_list, multiple_select, self.callback_ui) def run(self): """ Start the ui """ self.ui.run() self.ui = None return self.choices def stop(self): """ Stop the ui """ self.ui.stop() def callback_ui(self, ui, command, choices): """ This method is executed when ok, cancel, or x is pressed in the ui. """ if command == 'update': # OK was pressed self.choices = choices if self.callback: # If a callback was set, call main process self.callback(self) else: self.stop() elif command == 'x': self.stop() self.choices = None elif command == 'cancel': self.stop() self.choices = None # methods to change properties -------------- @property def msg(self): """Text in msg Area""" return self._msg @msg.setter def msg(self, msg): self.ui.set_msg(msg) @msg.deleter def msg(self): self._msg = "" self.ui.set_msg(self._msg) # Methods to validate what will be sent to ui --------- def to_list_of_str(self, choices): choices = [str(c) for c in choices] while len(choices) < 2: raise ValueError('at least two choices need to be specified') return choices class GUItk(object): """ This object contains the tk root object. It draws the window, waits for events and communicates them to MultiBox, together with the entered values. The position in wich it is drawn comes from a global variable. It also accepts commands from Multibox to change its message. """ def __init__(self, msg, title, choices, preselect, multiple_select, callback): self.callback = callback self.choices = choices self.width_in_chars = global_state.prop_font_line_length # Initialize self.selected_choices # This is the value that will be returned if the user clicks the close # icon # self.selected_choices = None self.multiple_select = multiple_select self.boxRoot = tk.Tk() self.boxFont = tk_Font.nametofont("TkTextFont") self.config_root(title) self.set_pos(global_state.window_position) # GLOBAL POSITION self.create_msg_widget(msg) self.create_choicearea() self.create_ok_button() self.create_cancel_button() self.create_special_buttons() self.preselect_choice(preselect) self.choiceboxWidget.focus_force() # Run and stop methods --------------------------------------- def run(self): self.boxRoot.mainloop() # run it! self.boxRoot.destroy() # Close the window def stop(self): # Get the current position before quitting self.get_pos() self.boxRoot.quit() def x_pressed(self): self.callback(self, command='x', choices=self.get_choices()) def cancel_pressed(self, event): self.callback(self, command='cancel', choices=self.get_choices()) def ok_pressed(self, event): self.callback(self, command='update', choices=self.get_choices()) # Methods to change content --------------------------------------- # Methods to change content --------------------------------------- def set_msg(self, msg): self.messageArea.config(state=tk.NORMAL) self.messageArea.delete(1.0, tk.END) self.messageArea.insert(tk.END, msg) self.messageArea.config(state=tk.DISABLED) # Adjust msg height self.messageArea.update() numlines = self.get_num_lines(self.messageArea) self.set_msg_height(numlines) self.messageArea.update() # put the focus on the entryWidget def set_msg_height(self, numlines): self.messageArea.configure(height=numlines) def get_num_lines(self, widget): end_position = widget.index(tk.END) # '4.0' end_line = end_position.split('.')[0] # 4 return int(end_line) + 1 # 5 def set_pos(self, pos=None): if not pos: pos = global_state.window_position self.boxRoot.geometry(pos) def get_pos(self): # The geometry() method sets a size for the window and positions it on # the screen. The first two parameters are width and height of # the window. The last two parameters are x and y screen coordinates. # geometry("250x150+300+300") geom = self.boxRoot.geometry() # "628x672+300+200" global_state.window_position = '+' + geom.split('+', 1)[1] def preselect_choice(self, preselect): if preselect != None: for v in preselect: self.choiceboxWidget.select_set(v) self.choiceboxWidget.activate(v) def get_choices(self): choices_index = self.choiceboxWidget.curselection() if not choices_index: return None if self.multiple_select: selected_choices = [self.choiceboxWidget.get(index) for index in choices_index] else: selected_choices = self.choiceboxWidget.get(choices_index) return selected_choices # Auxiliary methods ----------------------------------------------- def calc_character_width(self): char_width = self.boxFont.measure('W') return char_width def config_root(self, title): screen_width = self.boxRoot.winfo_screenwidth() screen_height = self.boxRoot.winfo_screenheight() self.root_width = int((screen_width * 0.8)) root_height = int((screen_height * 0.5)) self.boxRoot.title(title) self.boxRoot.iconname('Dialog') self.boxRoot.expand = tk.NO # self.boxRoot.minsize(width=62 * self.calc_character_width()) self.set_pos() self.boxRoot.protocol('WM_DELETE_WINDOW', self.x_pressed) self.boxRoot.bind('', self.KeyboardListener) self.boxRoot.bind("", self.cancel_pressed) self.boxRoot.attributes("-topmost", True) # Put the dialog box in focus. def create_msg_widget(self, msg): if msg is None: msg = "" self.msgFrame = tk.Frame( self.boxRoot, padx=2 * self.calc_character_width(), ) self.messageArea = tk.Text( self.msgFrame, width=self.width_in_chars, state=tk.DISABLED, background=self.boxRoot.config()["background"][-1], relief='flat', padx=(global_state.default_hpad_in_chars * self.calc_character_width()), pady=(global_state.default_hpad_in_chars * self.calc_character_width()), wrap=tk.WORD, ) self.set_msg(msg) self.msgFrame.pack(side=tk.TOP, expand=1, fill='both') self.messageArea.pack(side=tk.TOP, expand=1, fill='both') def create_choicearea(self): self.choiceboxFrame = tk.Frame(master=self.boxRoot) self.choiceboxFrame.pack(side=tk.TOP, fill=tk.BOTH, expand=tk.YES) lines_to_show = min(len(self.choices), 20) # -------- put the self.choiceboxWidget in the self.choiceboxFrame --- self.choiceboxWidget = tk.Listbox(self.choiceboxFrame, height=lines_to_show, borderwidth="1m", relief="flat", bg="white" ) if self.multiple_select: self.choiceboxWidget.configure(selectmode=tk.MULTIPLE) # self.choiceboxWidget.configure(font=(global_state.PROPORTIONAL_FONT_FAMILY, # global_state.PROPORTIONAL_FONT_SIZE)) # add a vertical scrollbar to the frame rightScrollbar = tk.Scrollbar(self.choiceboxFrame, orient=tk.VERTICAL, command=self.choiceboxWidget.yview) self.choiceboxWidget.configure(yscrollcommand=rightScrollbar.set) # add a horizontal scrollbar to the frame bottomScrollbar = tk.Scrollbar(self.choiceboxFrame, orient=tk.HORIZONTAL, command=self.choiceboxWidget.xview) self.choiceboxWidget.configure(xscrollcommand=bottomScrollbar.set) # pack the Listbox and the scrollbars. # Note that although we must define # the textArea first, we must pack it last, # so that the bottomScrollbar will # be located properly. bottomScrollbar.pack(side=tk.BOTTOM, fill=tk.X) rightScrollbar.pack(side=tk.RIGHT, fill=tk.Y) self.choiceboxWidget.pack( side=tk.LEFT, padx="1m", pady="1m", expand=tk.YES, fill=tk.BOTH) # Insert choices widgets for choice in self.choices: self.choiceboxWidget.insert(tk.END, choice) # Bind the keyboard events self.choiceboxWidget.bind("", self.ok_pressed) self.choiceboxWidget.bind("", self.ok_pressed) def create_ok_button(self): self.buttonsFrame = tk.Frame(self.boxRoot) self.buttonsFrame.pack(side=tk.TOP, expand=tk.YES, pady=0) # put the buttons in the self.buttonsFrame okButton = tk.Button(self.buttonsFrame, takefocus=tk.YES, text="OK", height=1, width=6) bindArrows(okButton) okButton.pack(expand=tk.NO, side=tk.RIGHT, padx='2m', pady='1m', ipady="1m", ipadx="2m") # for the commandButton, bind activation events okButton.bind("", self.ok_pressed) okButton.bind("", self.ok_pressed) okButton.bind("", self.ok_pressed) def create_cancel_button(self): cancelButton = tk.Button(self.buttonsFrame, takefocus=tk.YES, text="Cancel", height=1, width=6) bindArrows(cancelButton) cancelButton.pack(expand=tk.NO, side=tk.LEFT, padx='2m', pady='1m', ipady="1m", ipadx="2m") cancelButton.bind("", self.cancel_pressed) cancelButton.bind("", self.cancel_pressed) # self.cancelButton.bind("", self.cancel_pressed) # for the commandButton, bind activation events to the activation event # handler def create_special_buttons(self): # add special buttons for multiple select features if not self.multiple_select: return selectAllButton = tk.Button( self.buttonsFrame, text="Select All", height=1, width=6) selectAllButton.pack(expand=tk.NO, side=tk.LEFT, padx='2m', pady='1m', ipady="1m", ipadx="2m") clearAllButton = tk.Button(self.buttonsFrame, text="Clear All", height=1, width=6) clearAllButton.pack(expand=tk.NO, side=tk.LEFT, padx='2m', pady='1m', ipady="1m", ipadx="2m") selectAllButton.bind("", self.choiceboxSelectAll) bindArrows(selectAllButton) clearAllButton.bind("", self.choiceboxClearAll) bindArrows(clearAllButton) def KeyboardListener(self, event): key = event.keysym if len(key) <= 1: if key in string.printable: # Find the key in the liglobal_state. # before we clear the list, remember the selected member try: start_n = int(self.choiceboxWidget.curselection()[0]) except IndexError: start_n = -1 # clear the selection. self.choiceboxWidget.selection_clear(0, 'end') # start from previous selection +1 for n in range(start_n + 1, len(self.choices)): item = self.choices[n] if item[0].lower() == key.lower(): self.choiceboxWidget.selection_set(first=n) self.choiceboxWidget.see(n) return else: # has not found it so loop from top for n, item in enumerate(self.choices): if item[0].lower() == key.lower(): self.choiceboxWidget.selection_set(first=n) self.choiceboxWidget.see(n) return # nothing matched -- we'll look for the next logical choice for n, item in enumerate(self.choices): if item[0].lower() > key.lower(): if n > 0: self.choiceboxWidget.selection_set( first=(n - 1)) else: self.choiceboxWidget.selection_set(first=0) self.choiceboxWidget.see(n) return # still no match (nothing was greater than the key) # we set the selection to the first item in the list lastIndex = len(self.choices) - 1 self.choiceboxWidget.selection_set(first=lastIndex) self.choiceboxWidget.see(lastIndex) return def choiceboxClearAll(self, event): self.choiceboxWidget.selection_clear(0, len(self.choices) - 1) def choiceboxSelectAll(self, event): self.choiceboxWidget.selection_set(0, len(self.choices) - 1) if __name__ == '__main__': users_choice = multchoicebox(choices=['choice1', 'choice2']) print("User's choice is: {}".format(users_choice)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/boxes/demo.py0000666000000000000000000003560500000000000014251 0ustar00""" .. moduleauthor:: easygui developers and Stephen Raymond Ferg .. default-domain:: py .. highlight:: python """ import os import sys try: from . import utils as ut from .button_box import buttonbox from .text_box import textbox from .diropen_box import diropenbox from .fileopen_box import fileopenbox from .filesave_box import filesavebox from .multi_fillable_box import multenterbox from .multi_fillable_box import multpasswordbox from .derived_boxes import ynbox from .derived_boxes import ccbox from .derived_boxes import boolbox from .derived_boxes import indexbox from .derived_boxes import msgbox from .derived_boxes import integerbox from .derived_boxes import enterbox from .derived_boxes import exceptionbox from .derived_boxes import codebox from .derived_boxes import passwordbox from .choice_box import choicebox from .choice_box import multchoicebox from . import about from .about import eg_version from .about import abouteasygui except (SystemError, ValueError, ImportError): print("Please run demo.py from outside the package") exit() # -------------------------------------------------------------- # # test/demo easygui # # ----------------------------------------------------------------------- package_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) class Demos(object): """ Collection of demos A choice is comprised of two pieces of data: - a description, which is a string. The descriptions will be shown in the choicebox, and one will be returned by it. - a function to execute when the description is selected """ def __init__(self): self.demos = [ ("msgbox", demo_msgbox), ("ynbox", demo_ynbox), ("ccbox", demo_ccbox), ("boolbox", demo_boolbox), ("buttonbox", demo_buttonbox), ("buttonbox that displays an image", demo_buttonbox_with_image), ("buttonbox - select an image", demo_buttonbox_with_choice), ("indexbox", demo_indexbox), ("choicebox", demo_choicebox), ("multchoicebox", demo_multichoicebox), ("textbox", demo_textbox), ("codebox", demo_codebox), ("enterbox", demo_enterbox), ("integerbox", demo_integerbox), ("passwordbox", demo_passwordbox), ("multenterbox", demo_multenterbox), ("multpasswordbox", demo_multpasswordbox), ("enterbox that displays an image", demo_enterbox_image), ("filesavebox", demo_filesavebox), ("fileopenbox", demo_fileopenbox), ("diropenbox", demo_diropenbox), ("exceptionbox", demo_exceptionbox), ("About EasyGui", demo_about), ("Help", demo_help), ] def list_descriptions(self): descriptions = [c[0] for c in self.demos] return descriptions def get_demo(self, index): demo = self.demos[index] # demo = next((c[1] for c in self.demo if c[0] == description)) return demo[1] def get_description(self, index): demo = self.demos[index] return demo[0] def __len__(self): return len(self.demos) def easygui_demo(): """ Run the EasyGui demo. """ demos = Demos() replies = [''] * len(demos) # clear the console print('\n' * 100) msg = [] msg.append("Pick the kind of box that you wish to demo.") msg.append(" * Python version {}".format(sys.version)) msg.append(" * EasyGui version {}".format(eg_version)) msg.append(" * Tk version {}".format(ut.TkVersion)) intro_message = "\n".join(msg) title = "EasyGui " + eg_version # Table that relates keys in choicebox with functions to execute descriptions = demos.list_descriptions() preselected = 0 while True: presented_choices = [ d + r for d, r in zip(descriptions, replies)] reply = choicebox(msg=intro_message, title=title, choices=presented_choices, preselect=preselected ) if not reply: break print(reply) index_chosen_demo = presented_choices.index(reply) # Execute the chosen demo! chosen_demo = demos.get_demo(index_chosen_demo) demo_reply = chosen_demo() # Save the reply if demo_reply: replies[index_chosen_demo] = ' - Last reply: {}'.format(demo_reply) else: replies[index_chosen_demo] = '' preselected += 1 if preselected >= len(presented_choices): preselected = 0 def demo_msgbox(): reply = msgbox("short msg", "This is a long title") print("Reply was: {!r}".format(reply)) return reply def demo_buttonbox(): reply = buttonbox(choices=['one', 'two', 'two', 'three'], default_choice='two') print("Reply was: {!r}".format(reply)) title = "Demo of Buttonbox with many, many buttons!" msg = ("This buttonbox shows what happens when you " "specify too many buttons.") reply = buttonbox(msg=msg, title=title, choices=['1', '2', '3', '4', '5', '6', '7'], cancel_choice='7') print("Reply was: {!r}".format(reply)) return reply def demo_buttonbox_with_image(): msg = "Do you like this picture?\nIt is " choices = ["Yes", "No", "No opinion"] for image in [ os.path.join(package_dir, "python_and_check_logo.gif"), os.path.join(package_dir, "python_and_check_logo.jpg"), os.path.join(package_dir, "python_and_check_logo.png"), os.path.join(package_dir, "zzzzz.gif")]: reply = buttonbox(msg + image, image=image, choices=choices) print("Reply was: {!r}".format(reply)) return reply def demo_buttonbox_with_choice(): msg = "Pick an image" choices = ['cancel'] images = list() images.append(os.path.join(package_dir, "python_and_check_logo.gif")) images.append(os.path.join(package_dir, "python_and_check_logo.jpg")) images.append(os.path.join(package_dir, "python_and_check_logo.png")) images.append(os.path.join(package_dir, "zzzzz.gif")) reply = buttonbox(msg, images=images, choices=['cancel']) print("Reply was: {!r}".format(reply)) return reply def demo_ccbox(): msg = "Insert your favorite message here" title = "Demo of ccbox" reply = ccbox(msg, title) print("Reply was: {!r}".format(reply)) return reply def demo_multichoicebox(): listChoices = ["aaa", "bbb", "ccc", "ggg", "hhh", "iii", "jjj", "kkk", "LLL", "mmm", "nnn", "ooo", "ppp", "qqq", "rrr", "sss", "ttt", "uuu", "vvv"] preselect = None #[0, 2, 4] msg = "Pick as many choices as you wish." reply = multchoicebox(msg, "Demo of multchoicebox", listChoices, preselect) print("Reply was: {!r}".format(reply)) return reply def demo_ynbox(): title = "Demo of ynbox" msg = "Were you expecting the Spanish Inquisition?" reply = ynbox(msg, title) print("Reply was: {!r}".format(reply)) if reply: msgbox("NOBODY expects the Spanish Inquisition!", "Wrong!") return reply def demo_choicebox(): title = "Demo of choicebox" longchoice = ( "This is an example of a very long option " "which you may or may not wish to choose." * 2) listChoices = ["nnn", "ddd", "eee", "fff", "aaa", longchoice, "aaa", "bbb", "ccc", "ggg", "hhh", "iii", "jjj", "kkk", "LLL", "mmm", "nnn", "ooo", "ppp", "qqq", "rrr", "sss", "ttt", "uuu", "vvv"] msg = ("Pick something. " + ("A wrapable sentence of text ?! " * 30) + "\nA separate line of text." * 6) reply = choicebox(msg=msg, choices=listChoices) print("Reply was: {!r}".format(reply)) msg = "Pick something. " reply = choicebox(msg=msg, title=title, choices=listChoices) print("Reply was: {!r}".format(reply)) msg = "Pick something. " reply = choicebox( msg="The list of choices is empty!", choices=list()) print("Reply was: {!r}".format(reply)) return reply def demo_integerbox(): reply = integerbox( "Enter a number between 3 and 333", "Demo: integerbox WITH a default value", 222, 3, 333) print("Reply was: {!r}".format(reply)) reply = integerbox( "Enter a number between 0 and 99", "Demo: integerbox WITHOUT a default value" ) print("Reply was: {!r}".format(reply)) return reply def demo_about(): reply = abouteasygui() print("Reply was: {!r}".format(reply)) return reply def demo_enterbox(): image = os.path.join(package_dir, "python_and_check_logo.gif") message = ("Enter the name of your best friend." "\n(Result will be stripped.)") reply = enterbox(message, "Love!", " Suzy Smith ") print("Reply was: {!r}".format(reply)) message = ("Enter the name of your best friend." "\n(Result will NOT be stripped.)") reply = enterbox( message, "Love!", " Suzy Smith ", strip=False) print("Reply was: {!r}".format(reply)) reply = enterbox("Enter the name of your worst enemy:", "Hate!") print("Reply was: {!r}".format(reply)) return reply def demo_multpasswordbox(): msg = "Enter logon information" title = "Demo of multpasswordbox" fieldNames = ["Server ID", "User ID", "Password"] fieldValues = list() # we start with blanks for the values fieldValues = multpasswordbox(msg, title, fieldNames) # make sure that none of the fields was left blank while True: if fieldValues is None: break errs = list() for n, v in zip(fieldNames, fieldValues): if v.strip() == "": errs.append('"{}" is a required field.\n\n'.format(n)) if not len(errs): break # no problems found fieldValues = multpasswordbox( "".join(errs), title, fieldNames, fieldValues) print("Reply was: {!s}".format(fieldValues)) return fieldValues def demo_textbox(): text_snippet = (( "It was the best of times, and it was the worst of times. The rich " "ate cake, and the poor had cake recommended to them, but wished " "only for enough cash to buy bread. The time was ripe for " "revolution! " * 5) + "\n\n") * 10 title = "Demo of textbox" msg = "Here is some sample text. " * 16 reply = textbox(msg, title, text_snippet) print("Reply was: {!s}".format(reply)) return reply def demo_codebox(): # TODO RL: Turn this sample code into the code in this module, just for fun code_snippet = ("dafsdfa dasflkj pp[oadsij asdfp;ij asdfpjkop asdfpok asdfpok asdfpok" * 3) + "\n" + """# here is some dummy Python code for someItem in myListOfStuff: do something(someItem) do something() do something() if somethingElse(someItem): doSomethingEvenMoreInteresting() """ * 16 msg = "Here is some sample code. " * 16 reply = codebox(msg, "Code Sample", code_snippet) print("Reply was: {!r}".format(reply)) return reply def demo_boolbox(): reply = boolbox() print("Reply was: {!r}".format(reply)) return reply def demo_enterbox_image(): image = os.path.join(package_dir, "python_and_check_logo.gif") message = "What kind of snake is this?" reply = enterbox(message, "Quiz", image=image) print("Reply was: {!r}".format(reply)) return reply def demo_passwordbox(): reply = passwordbox("Demo of password box WITHOUT default" + "\n\nEnter your secret password", "Member Logon") print("Reply was: {!s}".format(reply)) reply = passwordbox("Demo of password box WITH default" + "\n\nEnter your secret password", "Member Logon", "alfie") print("Reply was: {!s}".format(reply)) return reply def demo_help(): codebox("EasyGui Help", text=about.EASYGUI_ABOUT_INFORMATION) return None def demo_filesavebox(): filename = "myNewFile.txt" title = "File SaveAs" msg = "Save file as:" f = filesavebox(msg, title, default=filename) print("You chose to save file: {}".format(f)) return f def demo_diropenbox(): title = "Demo of diropenbox" msg = "Pick the directory that you wish to open." d = diropenbox(msg, title) print("You chose directory...: {}".format(d)) d = diropenbox(msg, title, default="./") print("You chose directory...: {}".format(d)) d = diropenbox(msg, title, default="c:/") print("You chose directory...: {}".format(d)) return d def demo_exceptionbox(): try: thisWillCauseADivideByZeroException = 1 / 0 except: exceptionbox() return None def demo_indexbox(): title = "Indexbox" msg = "Demo of " + "indexbox" choices = ["Choice1", "Choice2", "Choice3", "Choice4"] reply = indexbox(msg, title, choices) print("Reply was: {!r}".format(reply)) return reply def demo_multenterbox(): msg = "Enter your personal information" title = "Credit Card Application" fieldNames = ["Name", "Street Address", "City", "State", "ZipCode"] fieldValues = list() # we start with blanks for the values fieldValues = multenterbox(msg, title, fieldNames) # make sure that none of the fields was left blank while True: if fieldValues is None: break errs = list() for n, v in zip(fieldNames, fieldValues): if v.strip() == "": errs.append('"{}" is a required field.'.format(n)) if not len(errs): break # no problems found fieldValues = multenterbox( "\n".join(errs), title, fieldNames, fieldValues) print("Reply was: {}".format(fieldValues)) return fieldValues def demo_fileopenbox(): msg = "Python files" title = "Open files" default = "*.py" f = fileopenbox(msg, title, default=default) print("You chose to open file: {}".format(f)) default = "./*.gif" msg = "Some other file types (Multi-select)" filetypes = ["*.jpg", ["*.zip", "*.tgs", "*.gz", "Archive files"], ["*.htm", "*.html", "HTML files"]] f = fileopenbox( msg, title, default=default, filetypes=filetypes, multiple=True) print("You chose to open file: %s" % f) return f ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/boxes/derived_boxes.py0000666000000000000000000003756400000000000016155 0ustar00""" .. moduleauthor:: easygui developers and Stephen Raymond Ferg .. default-domain:: py .. highlight:: python """ try: from .fillable_box import __fillablebox from .button_box import buttonbox from . import text_box as tb from . import utils as ut except (SystemError, ValueError, ImportError): from fillable_box import __fillablebox from button_box import buttonbox import text_box as tb import utils as ut # ------------------------------------------------------------------- # various boxes built on top of the basic buttonbox # ----------------------------------------------------------------------- # ----------------------------------------------------------------------- # ynbox # ----------------------------------------------------------------------- def ynbox(msg="Shall I continue?", title=" ", choices=("[]Yes", "[]No"), image=None, default_choice='[]Yes', cancel_choice='[]No'): """ The ``ynbox()`` offers a choice of Yes and No, and returns either ``True`` or ``False``. import easygui result = easygui.ynbox('Is a hot dog a sandwich?', 'Hot Dog Question') if result == True: easygui.msgbox('That is an interesting answer.') else: easygui.msgbox('Well, that is your opinion.') :param msg: the msg to be displayed :type msg: str :param str title: the window title :param list choices: a list or tuple of the choices to be displayed :param str image: Filename of image to display :param str default_choice: The choice you want highlighted when the gui appears :param str cancel_choice: If the user presses the 'X' close, which button should be pressed :return: True if 'Yes' or dialog is cancelled, False if 'No' """ return boolbox(msg=msg, title=title, choices=choices, image=image, default_choice=default_choice, cancel_choice=cancel_choice) # ----------------------------------------------------------------------- # ccbox # ----------------------------------------------------------------------- def ccbox(msg="Shall I continue?", title=" ", choices=("C[o]ntinue", "C[a]ncel"), image=None, default_choice='Continue', cancel_choice='Cancel'): """ The ``ccbox()`` function offers a choice of Continue and Cancel, and returns either True (for continue) or False (for cancel). import easygui msg = "Do you want to continue?" title = "Please Confirm" if easygui.ccbox(msg, title): # Show a Continue/Cancel dialog. pass # User chose Continue. else: # User chose Cancel. sys.exit() :param str msg: the msg to be displayed :param str title: the window title :param list choices: a list or tuple of the choices to be displayed :param str image: Filename of image to display :param str default_choice: The choice you want highlighted when the gui appears :param str cancel_choice: If the user presses the 'X' close, which button should be pressed :return: True if 'Continue' or dialog is cancelled, False if 'Cancel' """ return boolbox(msg=msg, title=title, choices=choices, image=image, default_choice=default_choice, cancel_choice=cancel_choice) # ----------------------------------------------------------------------- # boolbox # ----------------------------------------------------------------------- def boolbox(msg="Shall I continue?", title=" ", choices=("[T]rue", "[F]alse"), image=None, default_choice='[T]rue', cancel_choice='[F]alse'): """ The ``boolbox()`` (boolean box) displays two buttons. Returns returns ``True`` if the first button is chosen. Otherwise returns ``False``. import easygui message = "What do they say?" title = "Romantic Question" if easygui.boolbox(message, title, ["They love me", "They love me not"]): easygui.msgbox('You should send them flowers.') else: easygui.msgbox('It was not meant to be.') :param str msg: The message shown in the center of the dialog window. :param str title: The window title text. :param list choices: A list or tuple of strings for the buttons' text. :param str image: The filename of an image to display in the dialog window. :param str default_choice: The text of the default selected button. :param str cancel_choice: If the user presses the 'X' close, which button should be pressed :return: `True` if first button pressed or dialog is cancelled, `False` if second button is pressed. """ if len(choices) != 2: raise AssertionError( 'boolbox() takes exactly 2 choices! Consider using indexbox() instead.' ) reply = buttonbox(msg=msg, title=title, choices=choices, image=image, default_choice=default_choice, cancel_choice=cancel_choice) if reply == choices[0]: return True # The first button (True) was selected. elif reply == choices[1]: return False # The second button (False) was selected. elif reply is None: return None # The window was closed. assert False, "The user selected an unexpected response." # ----------------------------------------------------------------------- # indexbox # ----------------------------------------------------------------------- def indexbox(msg="Shall I continue?", title=" ", choices=("Yes", "No"), image=None, default_choice='Yes', cancel_choice='No'): """ The ``indexbox()`` function displays a set of buttons, and returns the index of the selected button. For example, if you invoked index box with three choices (A, B, C), indexbox would return 0 if the user picked A, 1 if he picked B, and 2 if he picked C. import easygui result = easygui.indexbox('Which door do you choose?', 'Win Prizes!', choices=['Door 1', 'Door 2', 'Door 3']) if result == 2: easygui.msgbox('You win a new car!') else: easygui.msgbox('Better luck next time.') :param str msg: the msg to be displayed :param str title: the window title :param list choices: a list or tuple of the choices to be displayed :param str image: Filename of image to display :param str default_choice: The choice you want highlighted when the gui appears :param str cancel_choice: If the user presses the 'X' close, which button should be pressed :return: the index of the choice selected, starting from 0 """ reply = buttonbox(msg=msg, title=title, choices=choices, image=image, default_choice=default_choice, cancel_choice=cancel_choice) if reply is None: return None for i, choice in enumerate(choices): if reply == choice: return i msg = ("There is a program logic error in the EasyGui code " "for indexbox.\nreply={0}, choices={1}".format( reply, choices)) raise AssertionError(msg) # ----------------------------------------------------------------------- # msgbox # ----------------------------------------------------------------------- def msgbox(msg="(Your message goes here)", title=" ", ok_button="OK", image=None, root=None): """ The ``msgbox()`` function displays a text message and offers an OK button. The message text appears in the center of the window, the title text appears in the title bar, and you can replace the "OK" default text on the button. Here is the signature:: def msgbox(msg="(Your message goes here)", title="", ok_button="OK"): .... The clearest way to override the button text is to do it with a keyword argument, like this:: easygui.msgbox("Backup complete!", ok_button="Good job!") Here are a couple of examples:: easygui.msgbox("Hello, world!") :param str msg: the msg to be displayed :param str title: the window title :param str ok_button: text to show in the button :param str image: Filename of image to display :param tk_widget root: Top-level Tk widget :return: the text of the ok_button """ if not isinstance(ok_button, ut.basestring): raise AssertionError( "The 'ok_button' argument to msgbox must be a string.") return buttonbox(msg=msg, title=title, choices=[ok_button], image=image, default_choice=ok_button, cancel_choice=ok_button) def convert_to_type(input_value, new_type, input_value_name=None): """ Attempts to convert input_value to type new_type and throws error if it can't. If input_value is None, None is returned If new_type is None, input_value is returned unchanged :param input_value: Value to be converted :param new_type: Type to convert to :param input_value_name: If not None, used in error message if input_value cannot be converted :return: input_value converted to new_type, or None """ if input_value is None or new_type is None: return input_value exception_string = ( 'value {0}:{1} must be of type {2}.') ret_value = new_type(input_value) # except ValueError: # raise ValueError( # exception_string.format('default', default, type(default))) return ret_value # ------------------------------------------------------------------- # integerbox # ------------------------------------------------------------------- def integerbox(msg="", title=" ", default=None, lowerbound=0, upperbound=99, image=None, root=None): """ Show a box in which a user can enter an integer. In addition to arguments for msg and title, this function accepts integer arguments for "default", "lowerbound", and "upperbound". The default, lowerbound, or upperbound may be None. When the user enters some text, the text is checked to verify that it can be converted to an integer between the lowerbound and upperbound. If it can be, the integer (not the text) is returned. If it cannot, then an error msg is displayed, and the integerbox is redisplayed. If the user cancels the operation, None is returned. :param str msg: the msg to be displayed :param str title: the window title :param int default: The default value to return :param int lowerbound: The lower-most value allowed :param int upperbound: The upper-most value allowed :param str image: Filename of image to display :param tk_widget root: Top-level Tk widget :return: the integer value entered by the user """ if not msg: msg = "Enter an integer between {0} and {1}".format( lowerbound, upperbound) # Validate the arguments for default, lowerbound and upperbound and # convert to integers default = convert_to_type(default, int, "default") lowerbound = convert_to_type(lowerbound, int, "lowerbound") upperbound = convert_to_type(upperbound, int, "upperbound") while True: reply = enterbox(msg, title, default, image=image, root=root) if reply is None: return None try: reply = convert_to_type(reply, int) except ValueError: msgbox('The value that you entered:\n\t"{}"\nis not an integer.'.format(reply), "Error") continue if lowerbound is not None: if reply < lowerbound: msgbox('The value that you entered is less than the lower bound of {}.'.format(lowerbound), "Error") continue if upperbound is not None: if reply > upperbound: msgbox('The value that you entered is greater than the upper bound of {}.'.format(upperbound), "Error") continue # reply has passed all validation checks. # It is an integer between the specified bounds. break return reply # ------------------------------------------------------------------- # enterbox # ------------------------------------------------------------------- def enterbox(msg="Enter something.", title=" ", default="", strip=True, image=None, root=None): """ Show a box in which a user can enter some text. You may optionally specify some default text, which will appear in the enterbox when it is displayed. Example:: import easygui reply = easygui.enterbox('Enter your life story:') if reply: easygui.msgbox('Thank you for your response.') else: easygui.msgbox('Your response has been discarded.') :param str msg: the msg to be displayed. :param str title: the window title :param str default: value returned if user does not change it :param bool strip: If True, the return value will have its whitespace stripped before being returned :return: the text that the user entered, or None if they cancel the operation. """ result = __fillablebox( msg, title, default=default, mask=None, image=image, root=root) if result and strip: result = result.strip() return result def passwordbox(msg="Enter your password.", title=" ", default="", image=None, root=None): """ Show a box in which a user can enter a password. The text is masked with asterisks, so the password is not displayed. :param str msg: the msg to be displayed. :param str title: the window title :param str default: value returned if user does not change it :return: the text that the user entered, or None if they cancel the operation. """ return __fillablebox(msg, title, default, mask="*", image=image, root=root) # ----------------------------------------------------------------------- # exceptionbox # ----------------------------------------------------------------------- def exceptionbox(msg=None, title=None): """ Display a box that gives information about an exception that has just been raised. The caller may optionally pass in a title for the window, or a msg to accompany the error information. Note that you do not need to (and cannot) pass an exception object as an argument. The latest exception will automatically be used. :param str msg: the msg to be displayed :param str title: the window title :return: None """ if title is None: title = "Error Report" if msg is None: msg = "An error (exception) has occurred in the program." codebox(msg, title, ut.exception_format()) # ------------------------------------------------------------------- # codebox # ------------------------------------------------------------------- def codebox(msg="", title=" ", text=""): """ Display some text in a monospaced font, with no line wrapping. This function is suitable for displaying code and text that is formatted using spaces. The text parameter should be a string, or a list or tuple of lines to be displayed in the textbox. :param str msg: the msg to be displayed :param str title: the window title :param str text: what to display in the textbox """ return tb.textbox(msg, title, text, codebox=True) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/boxes/diropen_box.py0000666000000000000000000000354600000000000015634 0ustar00""" .. moduleauthor:: easygui developers and Stephen Raymond Ferg .. default-domain:: py .. highlight:: python Version |release| """ import os try: from . import utils as ut except (SystemError, ValueError, ImportError): import utils as ut try: import tkinter as tk # python 3 import tkinter.font as tk_Font except: import Tkinter as tk # python 2 import tkFont as tk_Font # ------------------------------------------------------------------- # diropenbox # ------------------------------------------------------------------- def diropenbox(msg=None, title=None, default=None): """ A dialog to get a directory name. Returns the name of a directory, or None if user chose to cancel. If the "default" argument specifies a directory name, and that directory exists, then the dialog box will start with that directory. :param str msg: used in the window title on some platforms :param str title: the window title :param str default: starting directory when dialog opens :return: Normalized path selected by user """ title = ut.getFileDialogTitle(msg, title) localRoot = tk.Tk() localRoot.withdraw() localRoot.lift() localRoot.attributes('-topmost', 1) localRoot.attributes('-topmost', 0) if not default: default = None localRoot.update() #fix ghost window issue #119 on mac. f = ut.tk_FileDialog.askdirectory( parent=localRoot, title=title, initialdir=default, initialfile=None ) localRoot.destroy() if not f: return None return os.path.normpath(f) if __name__ == '__main__': print("Hello from base_boxes") my_dir = diropenbox( "You really should open a file", title="Open a dir", default='./') print("directory {} selected.".format(my_dir)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/boxes/egstore.py0000666000000000000000000001071500000000000014770 0ustar00""" .. moduleauthor:: easygui developers and Stephen Raymond Ferg .. default-domain:: py .. highlight:: python Version |release| """ import errno import os import pickle import datetime def read_or_create_settings(file_name): settings = Settings(file_name) settings.restore() return settings class EgStore(object): """ A class to support persistent storage. You can use ``EgStore`` to support the storage and retrieval of user settings for an EasyGui application. **First: define a class named Settings as a subclass of EgStore** :: class Settings(EgStore): def __init__(self, filename): # filename is required # specify default values for variables that this application wants to remember self.user_id = '' self.target_server = '' settings.restore() *Second: create a persistent Settings object** :: settings = Settings('app_settings.txt') settings.user_id = 'obama_barak' settings.targetServer = 'whitehouse1' settings.store() # run code that gets a new value for user_id, and persist the settings settings.user_id = 'biden_joe' settings.store() **Example C: recover the Settings instance, change an attribute, and store it again.** :: settings = Settings('app_settings.txt') settings.restore() print settings settings.user_id = 'vanrossum_g' settings.store() """ def __init__(self, filename): """Initialize a store with the given filename. :param filename: the file that backs this store for saving and loading """ self.filename = filename def restore(self): try: self._restore() except IOError as e: if e.errno != errno.ENOENT: raise def _restore(self): """ Set the values of whatever attributes are recoverable from the pickle file. Populate the attributes (the __dict__) of the EgStore object from the attributes (the __dict__) of the pickled object. If the pickled object has attributes that have been initialized in the EgStore object, then those attributes of the EgStore object will be replaced by the values of the corresponding attributes in the pickled object. If the pickled object is missing some attributes that have been initialized in the EgStore object, then those attributes of the EgStore object will retain the values that they were initialized with. Where possible, the attributes will have values recovered from the pickled object. """ with open(self.filename, 'rb') as f: store = pickle.load(f) for key, value in store.__dict__.items(): self.__dict__[key] = value self.last_time_restored = datetime.datetime.now() def store(self): """Save this store to a pickle file. All directories in :attr:`filename` must already exist. """ with open(self.filename, 'wb') as f: self.last_time_stored = datetime.datetime.now() pickle.dump(self, f) def kill(self): """Delete this store's file if it exists.""" if os.path.isfile(self.filename): os.remove(self.filename) def __getstate__(self): """ All attributes will be pickled """ state = self.__dict__.copy() return state def __setstate__(self, state): """ Ensure filename won't be unpickled """ if 'filename' in state: del state['filename'] self.__dict__.update(state) def __str__(self): """"Format this store as "key : value" pairs, one per line.""" stored_values = self.__dict__ lines = [] width = max(len(key) for key in stored_values) for key in sorted(stored_values.keys()): value = stored_values[key] if isinstance(value, datetime.datetime): value = value.isoformat() lines.append('{0} : {1!r}'.format(key.ljust(width), value)) return '\n'.join(lines) def __repr__(self): return '{0}({1!r})'.format(self.__class__.__name__, self.filename) class Settings(EgStore): def __init__(self, filename): self.filename = filename ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/boxes/fileboxsetup.py0000666000000000000000000001232400000000000016027 0ustar00""" .. moduleauthor:: easygui developers and Stephen Raymond Ferg .. default-domain:: py .. highlight:: python Version |release| """ import os try: from . import utils as ut except (SystemError, ValueError, ImportError): import utils as ut try: import tkinter as tk # python 3 import tkinter.font as tk_Font except: import Tkinter as tk # python 2 import tkFont as tk_Font # ------------------------------------------------------------------- # # fileboxSetup # # ------------------------------------------------------------------- def fileboxSetup(default, filetypes): if not default: default = os.path.join(".", "*") initialdir, initialfile = os.path.split(default) if not initialdir: initialdir = "." if not initialfile: initialfile = "*" initialbase, initialext = os.path.splitext(initialfile) initialFileTypeObject = FileTypeObject(initialfile) allFileTypeObject = FileTypeObject("*") ALL_filetypes_was_specified = False if not filetypes: filetypes = list() filetypeObjects = list() for filemask in filetypes: fto = FileTypeObject(filemask) if fto.isAll(): ALL_filetypes_was_specified = True # remember this if fto == initialFileTypeObject: initialFileTypeObject.add(fto) # add fto to initialFileTypeObject else: filetypeObjects.append(fto) # ------------------------------------------------------------------ # make sure that the list of filetypes includes the ALL FILES type. # ------------------------------------------------------------------ if ALL_filetypes_was_specified: pass elif allFileTypeObject == initialFileTypeObject: pass else: filetypeObjects.insert(0, allFileTypeObject) # ------------------------------------------------------------------ # Make sure that the list includes the initialFileTypeObject # in the position in the list that will make it the default. # This changed between Python version 2.5 and 2.6 # ------------------------------------------------------------------ if len(filetypeObjects) == 0: filetypeObjects.append(initialFileTypeObject) if initialFileTypeObject in (filetypeObjects[0], filetypeObjects[-1]): pass else: if ut.runningPython27: filetypeObjects.append(initialFileTypeObject) else: filetypeObjects.insert(0, initialFileTypeObject) filetypes = [fto.toTuple() for fto in filetypeObjects] return initialbase, initialfile, initialdir, filetypes # Hotkeys if buttons: for button_name, button in buttons.items(): hotkey_pressed = event.keysym if event.keysym != event.char: # A special character hotkey_pressed = '<{}>'.format(event.keysym) if button['hotkey'] == hotkey_pressed: __replyButtonText = button_name boxRoot.quit() return print("Event not understood") # ------------------------------------------------------------------- # class FileTypeObject for use with fileopenbox # ------------------------------------------------------------------- class FileTypeObject: def __init__(self, filemask): if len(filemask) == 0: raise AssertionError('Filetype argument is empty.') self.masks = list() if isinstance(filemask, ut.basestring): # a str or unicode self.initializeFromString(filemask) elif isinstance(filemask, list): if len(filemask) < 2: raise AssertionError('Invalid filemask.\n' + 'List contains less than 2 members: "{}"'.format(filemask)) else: self.name = filemask[-1] self.masks = list(filemask[:-1]) else: raise AssertionError('Invalid filemask: "{}"'.format(filemask)) def __eq__(self, other): if self.name == other.name: return True return False def add(self, other): for mask in other.masks: if mask in self.masks: pass else: self.masks.append(mask) def toTuple(self): return self.name, tuple(self.masks) def isAll(self): if self.name == "All files": return True return False def initializeFromString(self, filemask): # remove everything except the extension from the filemask self.ext = os.path.splitext(filemask)[1] if self.ext == "": self.ext = ".*" if self.ext == ".": self.ext = ".*" self.name = self.getName() self.masks = ["*" + self.ext] def getName(self): e = self.ext file_types = {".*": "All", ".txt": "Text", ".py": "Python", ".pyc": "Python", ".xls": "Excel"} if e in file_types: return '{} files'.format(file_types[e]) if e.startswith("."): return '{} files'.format(e[1:].upper()) return '{} files'.format(e.upper()) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/boxes/fileopen_box.py0000666000000000000000000001036700000000000015774 0ustar00from __future__ import print_function """ .. moduleauthor:: easygui developers and Stephen Raymond Ferg .. default-domain:: py .. highlight:: python Version |release| """ import os try: from . import utils as ut from . import fileboxsetup as fbs except (SystemError, ValueError, ImportError): import utils as ut import fileboxsetup as fbs tk = ut.tk # ------------------------------------------------------------------- # fileopenbox # ------------------------------------------------------------------- def fileopenbox(msg=None, title=None, default='*', filetypes=None, multiple=False): """ Displays an "open file" dialog box and returns the selected file as a string. The "default" argument specifies a filepath that (normally) contains one or more wildcards. fileopenbox() will display only files that match the default filepath. If omitted, defaults to "\\*" (all files in the current directory). WINDOWS EXAMPLE:: ...default="c:/myjunk/*.py" will open in directory c:\\myjunk\\ and show all Python files. WINDOWS EXAMPLE:: ...default="c:/myjunk/test*.py" will open in directory c:\\myjunk\\ and show all Python files whose names begin with "test". Note that on Windows, fileopenbox automatically changes the path separator to the Windows path separator (backslash). **About the "filetypes" argument** If specified, it should contain a list of items, where each item is either: - a string containing a filemask # e.g. "\\*.txt" - a list of strings, where all of the strings except the last one are filemasks (each beginning with "\\*.", such as "\\*.txt" for text files, "\\*.py" for Python files, etc.). and the last string contains a filetype description EXAMPLE:: filetypes = ["*.css", ["*.htm", "*.html", "HTML files"] ] .. note:: If the filetypes list does not contain ("All files","*"), it will be added. If the filetypes list does not contain a filemask that includes the extension of the "default" argument, it will be added. For example, if default="\\*abc.py" and no filetypes argument was specified, then "\\*.py" will automatically be added to the filetypes argument. :param str msg: the msg to be displayed. :param str title: the window title :param str default: filepath with wildcards :param object filetypes: filemasks that a user can choose, e.g. "\\*.txt" :param bool multiple: If true, more than one file can be selected :return: the name of a file, or None if user chose to cancel """ localRoot = tk.Tk() localRoot.withdraw() initialbase, initialfile, initialdir, filetypes = fbs.fileboxSetup( default, filetypes) # ------------------------------------------------------------ # if initialfile contains no wildcards; we don't want an # initial file. It won't be used anyway. # Also: if initialbase is simply "*", we don't want an # initialfile; it is not doing any useful work. # ------------------------------------------------------------ if (initialfile.find("*") < 0) and (initialfile.find("?") < 0): initialfile = None elif initialbase == "*": initialfile = None func = ut.tk_FileDialog.askopenfilenames if multiple else ut.tk_FileDialog.askopenfilename ret_val = func(parent=localRoot, title=ut.getFileDialogTitle(msg, title), initialdir=initialdir, initialfile=initialfile, filetypes=filetypes ) if not ret_val or ret_val == '': localRoot.destroy() return None if multiple: f = [os.path.normpath(x) for x in localRoot.tk.splitlist(ret_val)] else: try: f = os.path.normpath(ret_val) except AttributeError as e: print("ret_val is {}".format(ret_val)) raise e localRoot.destroy() if not f: return None return f if __name__ == '__main__': print("Hello from file open box") ret_val = fileopenbox("Please select a file", "My File Open dialog") print("Return value is:{}".format(ret_val)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/boxes/filesave_box.py0000666000000000000000000000527700000000000015775 0ustar00""" .. moduleauthor:: easygui developers and Stephen Raymond Ferg .. default-domain:: py .. highlight:: python Version |release| """ import os try: from . import utils as ut from . import fileboxsetup as fbs except (SystemError, ValueError, ImportError): import utils as ut import fileboxsetup as fbs try: import tkinter as tk # python 3 import tkinter.font as tk_Font except: import Tkinter as tk # python 2 import tkFont as tk_Font # ------------------------------------------------------------------- # filesavebox # ------------------------------------------------------------------- def filesavebox(msg=None, title=None, default="", filetypes=None): """ A file to get the name of a file to save. Returns the name of a file, or None if user chose to cancel. **About the "default" argument** The ``default`` argument specifies the path and "glob pattern" for file names. The "\\*" value, for example, sets the open file dialog to the current working directory and showing all files. For another example, setting the ``default`` argument to ``"C:/myjunk/*.py"`` sets the open file dialog to the C:\\myjunk folder and showing only files that have the .py file extension. This glob pattern at the end of the ``default`` argument is required: passing ``"C:/myjunk"`` would not set the open file dialog to the C:\\myjunk folder, but rather to the C:\\ folder and "myjunk" as the initial filename. Note that on Windows, ``fileopenbox()`` automatically changes the path separator to the Windows path separator (backslash). The "filetypes" argument works like the "filetypes" argument to fileopenbox. :param str msg: the msg to be displayed. :param str title: the window title :param str default: default filename to return :param object filetypes: filemasks that a user can choose, e.g. " \\*.txt" :return: the name of a file, or None if user chose to cancel """ localRoot = tk.Tk() localRoot.withdraw() initialbase, initialfile, initialdir, filetypes = fbs.fileboxSetup( default, filetypes) f = ut.tk_FileDialog.asksaveasfilename( parent=localRoot, title=ut.getFileDialogTitle( msg, title), initialfile=initialfile, initialdir=initialdir, filetypes=filetypes ) localRoot.destroy() if not f: return None return os.path.normpath(f) if __name__ == '__main__': print("Hello from file save box") ret_val = filesavebox("Please select a file to save to", "My File Save dialog") print("Return value is:{}".format(ret_val))././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/boxes/fillable_box.py0000666000000000000000000001320100000000000015733 0ustar00try: from . import utils as ut from . import global_state from .base_boxes import bindArrows except (SystemError, ValueError, ImportError): import utils as ut import global_state from base_boxes import bindArrows try: import tkinter as tk # python 3 import tkinter.font as tk_Font except: import Tkinter as tk # python 2 import tkFont as tk_Font # TODO: bindArrows seems to be in the wrong place. boxRoot = None entryWidget = None __enterboxText = '' __enterboxDefaultText = '' cancelButton = None okButton = None def __fillablebox(msg, title="", default="", mask=None, image=None, root=None): """ Show a box in which a user can enter some text. You may optionally specify some default text, which will appear in the enterbox when it is displayed. Returns the text that the user entered, or None if they cancel the operation. """ global boxRoot, __enterboxText, __enterboxDefaultText global cancelButton, entryWidget, okButton if title is None: title = "" if default is None: default = "" __enterboxDefaultText = default __enterboxText = __enterboxDefaultText if root: root.withdraw() boxRoot = tk.Toplevel(master=root) boxRoot.withdraw() else: boxRoot = tk.Tk() boxRoot.withdraw() boxRoot.protocol('WM_DELETE_WINDOW', __enterboxQuit) boxRoot.title(title) boxRoot.iconname('Dialog') boxRoot.geometry(global_state.window_position) boxRoot.bind("", __enterboxCancel) # ------------- define the messageFrame --------------------------------- messageFrame = tk.Frame(master=boxRoot) messageFrame.pack(side=tk.TOP, fill=tk.BOTH) # ------------- define the imageFrame --------------------------------- try: tk_Image = ut.load_tk_image(image) except Exception as inst: print(inst) tk_Image = None if tk_Image: imageFrame = tk.Frame(master=boxRoot) imageFrame.pack(side=tk.TOP, fill=tk.BOTH) label = tk.Label(imageFrame, image=tk_Image) label.image = tk_Image # keep a reference! label.pack(side=tk.TOP, expand=tk.YES, fill=tk.X, padx='1m', pady='1m') # ------------- define the buttonsFrame --------------------------------- buttonsFrame = tk.Frame(master=boxRoot) buttonsFrame.pack(side=tk.TOP, fill=tk.BOTH) # ------------- define the entryFrame --------------------------------- entryFrame = tk.Frame(master=boxRoot) entryFrame.pack(side=tk.TOP, fill=tk.BOTH) # ------------- define the buttonsFrame --------------------------------- buttonsFrame = tk.Frame(master=boxRoot) buttonsFrame.pack(side=tk.TOP, fill=tk.BOTH) # -------------------- the msg widget ---------------------------- messageWidget = tk.Message(messageFrame, width="4.5i", text=msg) messageWidget.configure( font=(global_state.PROPORTIONAL_FONT_FAMILY, global_state.PROPORTIONAL_FONT_SIZE)) messageWidget.pack( side=tk.RIGHT, expand=1, fill=tk.BOTH, padx='3m', pady='3m') # --------- entryWidget ---------------------------------------------- entryWidget = tk.Entry(entryFrame, width=40) bindArrows(entryWidget) entryWidget.configure( font=(global_state.PROPORTIONAL_FONT_FAMILY, global_state.TEXT_ENTRY_FONT_SIZE)) if mask: entryWidget.configure(show=mask) entryWidget.pack(side=tk.LEFT, padx="3m") entryWidget.bind("", __enterboxGetText) entryWidget.bind("", __enterboxCancel) # put text into the entryWidget entryWidget.insert(0, __enterboxDefaultText) # ------------------ ok button ------------------------------- okButton = tk.Button(buttonsFrame, takefocus=1, text="OK") bindArrows(okButton) okButton.pack( expand=1, side=tk.LEFT, padx='3m', pady='3m', ipadx='2m', ipady='1m') # for the commandButton, bind activation events to the activation event # handler commandButton = okButton handler = __enterboxGetText for selectionEvent in global_state.STANDARD_SELECTION_EVENTS: commandButton.bind("<{}>".format(selectionEvent), handler) # ------------------ cancel button ------------------------------- cancelButton = tk.Button(buttonsFrame, takefocus=1, text="Cancel") bindArrows(cancelButton) cancelButton.pack( expand=1, side=tk.RIGHT, padx='3m', pady='3m', ipadx='2m', ipady='1m') # for the commandButton, bind activation events to the activation event # handler commandButton = cancelButton handler = __enterboxCancel for selectionEvent in global_state.STANDARD_SELECTION_EVENTS: commandButton.bind("<{}>".format(selectionEvent), handler) # ------------------- time for action! ----------------- entryWidget.focus_force() # put the focus on the entryWidget boxRoot.deiconify() boxRoot.mainloop() # run it! # -------- after the run has completed ---------------------------------- if root: root.deiconify() boxRoot.destroy() # button_click didn't destroy boxRoot, so we do it now return __enterboxText def __enterboxQuit(): return __enterboxCancel(None) def __enterboxCancel(event): global __enterboxText __enterboxText = None boxRoot.quit() def __enterboxGetText(event): global __enterboxText __enterboxText = entryWidget.get() boxRoot.quit() def __enterboxRestore(event): global entryWidget entryWidget.delete(0, len(entryWidget.get())) entryWidget.insert(0, __enterboxDefaultText) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/boxes/global_state.py0000666000000000000000000000123200000000000015752 0ustar00""" .. moduleauthor:: easygui developers and Stephen Raymond Ferg .. default-domain:: py .. highlight:: python Version |release| """ # Starting and global variables window_position = "+300+200" PROPORTIONAL_FONT_FAMILY = ("MS", "Sans", "Serif") MONOSPACE_FONT_FAMILY = "Courier" PROPORTIONAL_FONT_SIZE = 10 # a little smaller, because it is more legible at a smaller size MONOSPACE_FONT_SIZE = 9 TEXT_ENTRY_FONT_SIZE = 12 # a little larger makes it easier to see STANDARD_SELECTION_EVENTS = ["Return", "Button-1", "space"] prop_font_line_length = 62 fixw_font_line_length = 80 num_lines_displayed = 50 default_hpad_in_chars = 2 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/boxes/multi_fillable_box.py0000666000000000000000000004030600000000000017153 0ustar00""" .. moduleauthor:: easygui developers and Stephen Raymond Ferg .. default-domain:: py .. highlight:: python Version |release| """ try: from . import global_state except: import global_state try: import tkinter as tk # python 3 except: import Tkinter as tk # python 2 # ----------------------------------------------------------------------- # multpasswordbox # ----------------------------------------------------------------------- def multpasswordbox(msg="Fill in values for the fields.", title=" ", fields=tuple(), values=tuple(), callback=None, run=True): r""" Same interface as multenterbox. But in multpassword box, the last of the fields is assumed to be a password, and is masked with asterisks. :param str msg: the msg to be displayed. :param str title: the window title :param list fields: a list of fieldnames. :param list values: a list of field values :return: String **Example** Here is some example code, that shows how values returned from multpasswordbox can be checked for validity before they are accepted:: msg = "Enter logon information" title = "Demo of multpasswordbox" fieldNames = ["Server ID", "User ID", "Password"] fieldValues = [] # we start with blanks for the values fieldValues = multpasswordbox(msg,title, fieldNames) # make sure that none of the fields was left blank while 1: if fieldValues is None: break errmsg = "" for i in range(len(fieldNames)): if fieldValues[i].strip() == "": errmsg = errmsg + ('"%s" is a required field.\n\n' % fieldNames[i]) if errmsg == "": break # no problems found fieldValues = multpasswordbox(errmsg, title, fieldNames, fieldValues) print("Reply was: %s" % str(fieldValues)) """ if run: mb = MultiBox(msg, title, fields, values, mask_last=True, callback=callback) reply = mb.run() return reply else: mb = MultiBox(msg, title, fields, values, mask_last=True, callback=callback) return mb # ------------------------------------------------------------------- # multenterbox # ------------------------------------------------------------------- # TODO RL: Should defaults be list constructors. # i think after multiple calls, the value is retained. # TODO RL: Rename/alias to multienterbox? # default should be None and then in the logic create an empty liglobal_state. def multenterbox(msg="Fill in values for the fields.", title=" ", fields=[], values=[], callback=None, run=True): r""" Show screen with multiple data entry fields. If there are fewer values than names, the list of values is padded with empty strings until the number of values is the same as the number of names. If there are more values than names, the list of values is truncated so that there are as many values as names. Returns a list of the values of the fields, or None if the user cancels the operation. Here is some example code, that shows how values returned from multenterbox can be checked for validity before they are accepted:: msg = "Enter your personal information" title = "Credit Card Application" fieldNames = ["Name","Street Address","City","State","ZipCode"] fieldValues = [] # we start with blanks for the values fieldValues = multenterbox(msg,title, fieldNames) # make sure that none of the fields was left blank while 1: if fieldValues is None: break errmsg = "" for i in range(len(fieldNames)): if fieldValues[i].strip() == "": errmsg += ('"%s" is a required field.\n\n' % fieldNames[i]) if errmsg == "": break # no problems found fieldValues = multenterbox(errmsg, title, fieldNames, fieldValues) print("Reply was: %s" % str(fieldValues)) :param str msg: the msg to be displayed. :param str title: the window title :param list fields: a list of fieldnames. :param list values: a list of field values :return: String """ if run: mb = MultiBox(msg, title, fields, values, mask_last=False, callback=callback) reply = mb.run() return reply else: mb = MultiBox(msg, title, fields, values, mask_last=False, callback=callback) return mb class MultiBox(object): """ Show multiple data entry fields This object does a number of things: - chooses a GUI framework (wx, qt) - checks the data sent to the GUI - performs the logic (button ok should close the window?) - defines what methods the user can invoke and what properties he can change. - calls the ui in defined ways, so other gui frameworks can be used without breaking anything to the user """ def __init__(self, msg, title, fields, values, mask_last, callback): """ Create box object Parameters ---------- msg : string text displayed in the message area (instructions...) title : str the window title fields: list names of fields values: list initial values callback: function if set, this function will be called when OK is pressed run: bool if True, a box object will be created and returned, but not run Returns ------- self The MultiBox object """ self.callback = callback self.fields, self.values = self.check_fields(fields, values) self.ui = GUItk(msg, title, self.fields, self.values, mask_last, self.callback_ui) def run(self): """ Start the ui """ self.ui.run() self.ui = None return self.values def stop(self): """ Stop the ui """ self.ui.stop() def callback_ui(self, ui, command, values): """ This method is executed when ok, cancel, or x is pressed in the ui. """ if command == 'update': # OK was pressed self.values = values if self.callback: # If a callback was set, call main process self.callback(self) else: self.stop() elif command == 'x': self.stop() self.values = None elif command == 'cancel': self.stop() self.values = None # methods to change properties -------------- @property def msg(self): """Text in msg Area""" return self._msg @msg.setter def msg(self, msg): self.ui.set_msg(msg) @msg.deleter def msg(self): self._msg = "" self.ui.set_msg(self._msg) # Methods to validate what will be sent to ui --------- def check_fields(self, fields, values): if len(fields) == 0: return None fields = list(fields[:]) # convert possible tuples to a list values = list(values[:]) # convert possible tuples to a list # TODO RL: The following seems incorrect when values>fields. Replace # below with zip? if len(values) == len(fields): pass elif len(values) > len(fields): fields = fields[0:len(values)] else: while len(values) < len(fields): values.append("") return fields, values class GUItk(object): """ This object contains the tk root object. It draws the window, waits for events and communicates them to MultiBox, together with the entered values. The position in wich it is drawn comes from a global variable. It also accepts commands from Multibox to change its message. """ def __init__(self, msg, title, fields, values, mask_last, callback): self.callback = callback self.boxRoot = tk.Tk() self.create_root(title) self.set_pos(global_state.window_position) # GLOBAL POSITION self.create_msg_widget(msg) self.create_entryWidgets(fields, values, mask_last) self.create_buttons() self.entryWidgets[0].focus_force() # put the focus on the entryWidget # Run and stop methods --------------------------------------- def run(self): self.boxRoot.mainloop() # run it! self.boxRoot.destroy() # Close the window def stop(self): # Get the current position before quitting self.get_pos() self.boxRoot.quit() def x_pressed(self): self.callback(self, command='x', values=self.get_values()) def cancel_pressed(self, event): self.callback(self, command='cancel', values=self.get_values()) def ok_pressed(self, event): self.callback(self, command='update', values=self.get_values()) # Methods to change content --------------------------------------- def set_msg(self, msg): self.messageWidget.configure(text=msg) self.entryWidgets[0].focus_force() # put the focus on the entryWidget def set_pos(self, pos): self.boxRoot.geometry(pos) def get_pos(self): # The geometry() method sets a size for the window and positions it on # the screen. The first two parameters are width and height of # the window. The last two parameters are x and y screen coordinates. # geometry("250x150+300+300") geom = self.boxRoot.geometry() # "628x672+300+200" global_state.window_position = '+' + geom.split('+', 1)[1] def get_values(self): values = [] for entryWidget in self.entryWidgets: values.append(entryWidget.get()) return values # Initial configuration methods --------------------------------------- # These ones are just called once, at setting. def create_root(self, title): self.boxRoot.protocol('WM_DELETE_WINDOW', self.x_pressed) self.boxRoot.title(title) self.boxRoot.iconname('Dialog') self.boxRoot.bind("", self.cancel_pressed) self.boxRoot.attributes("-topmost", True) # Put the dialog box in focus. def create_msg_widget(self, msg): # -------------------- the msg widget ---------------------------- self.messageWidget = tk.Message(self.boxRoot, width="4.5i", text=msg) self.messageWidget.configure( font=(global_state.PROPORTIONAL_FONT_FAMILY, global_state.PROPORTIONAL_FONT_SIZE)) self.messageWidget.pack( side=tk.TOP, expand=1, fill=tk.BOTH, padx='3m', pady='3m') def create_entryWidgets(self, fields, values, mask_last): self.entryWidgets = [] lastWidgetIndex = len(fields) - 1 for widgetIndex in range(len(fields)): name = fields[widgetIndex] value = values[widgetIndex] entryFrame = tk.Frame(master=self.boxRoot) entryFrame.pack(side=tk.TOP, fill=tk.BOTH) # --------- entryWidget ------------------------------------------- labelWidget = tk.Label(entryFrame, text=name) labelWidget.pack(side=tk.LEFT) entryWidget = tk.Entry(entryFrame, width=40, highlightthickness=2) self.entryWidgets.append(entryWidget) entryWidget.configure( font=(global_state.PROPORTIONAL_FONT_FAMILY, global_state.TEXT_ENTRY_FONT_SIZE)) entryWidget.pack(side=tk.RIGHT, padx="3m") self.bindArrows(entryWidget) entryWidget.bind("", self.ok_pressed) entryWidget.bind("", self.cancel_pressed) # for the last entryWidget, if this is a multpasswordbox, # show the contents as just asterisks if widgetIndex == lastWidgetIndex: if mask_last: self.entryWidgets[widgetIndex].configure(show="*") # put text into the entryWidget if value is None: value = '' self.entryWidgets[widgetIndex].insert( 0, '{}'.format(value)) def create_buttons(self): self.buttonsFrame = tk.Frame(master=self.boxRoot) self.buttonsFrame.pack(side=tk.BOTTOM) self.create_cancel_button() self.create_ok_button() def create_ok_button(self): okButton = tk.Button(self.buttonsFrame, takefocus=1, text="OK") self.bindArrows(okButton) okButton.pack(expand=1, side=tk.LEFT, padx='3m', pady='3m', ipadx='2m', ipady='1m') # for the commandButton, bind activation events to the activation event # handler commandButton = okButton handler = self.ok_pressed for selectionEvent in global_state.STANDARD_SELECTION_EVENTS: commandButton.bind("<%s>" % selectionEvent, handler) def create_cancel_button(self): cancelButton = tk.Button(self.buttonsFrame, takefocus=1, text="Cancel") self.bindArrows(cancelButton) cancelButton.pack(expand=1, side=tk.LEFT, padx='3m', pady='3m', ipadx='2m', ipady='1m') # for the commandButton, bind activation events to the activation event # handler commandButton = cancelButton handler = self.cancel_pressed for selectionEvent in global_state.STANDARD_SELECTION_EVENTS: commandButton.bind("<%s>" % selectionEvent, handler) def bindArrows(self, widget): widget.bind("", self.tabRight) widget.bind("", self.tabLeft) widget.bind("", self.tabRight) widget.bind("", self.tabLeft) def tabRight(self, event): self.boxRoot.event_generate("") def tabLeft(self, event): self.boxRoot.event_generate("") def demo1(): msg = "Enter your personal information" title = "Credit Card Application" fieldNames = ["Name", "Street Address", "City", "State", "ZipCode"] fieldValues = [] # we start with blanks for the values # make sure that none of the fields was left blank while True: fieldValues = multenterbox(msg, title, fieldNames, fieldValues) cancelled = fieldValues is None errors = [] if cancelled: pass else: # check for errors for name, value in zip(fieldNames, fieldValues): if value.strip() == "": errors.append('"{}" is a required field.'.format(name)) all_ok = not errors if cancelled or all_ok: break # no problems found msg = "\n".join(errors) print("Reply was: {}".format(fieldValues)) class Demo2(): def __init__(self): msg = "Without flicker. Enter your personal information" title = "Credit Card Application" fieldNames = ["Name", "Street Address", "City", "State", "ZipCode"] fieldValues = [] # we start with blanks for the values fieldValues = multenterbox(msg, title, fieldNames, fieldValues, callback=self.check_for_blank_fields) print("Reply was: {}".format(fieldValues)) def check_for_blank_fields(self, box): # make sure that none of the fields was left blank cancelled = box.values is None errors = [] if cancelled: pass else: # check for errors for name, value in zip(box.fields, box.values): if value.strip() == "": errors.append('"{}" is a required field.'.format(name)) all_ok = not errors if cancelled or all_ok: box.stop() # no problems found box.msg = "\n".join(errors) if __name__ == '__main__': demo1() Demo2() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/boxes/text_box.py0000666000000000000000000004225100000000000015154 0ustar00""" .. moduleauthor:: easygui developers and Stephen Raymond Ferg .. default-domain:: py .. highlight:: python Version |release| """ import sys try: from . import global_state except (SystemError, ValueError, ImportError): import global_state try: import tkinter as tk # python 3 import tkinter.font as tk_Font except: import Tkinter as tk # python 2 import tkFont as tk_Font def demo_textbox(): demo_1() Demo2() Demo3() def demo_1(): title = "Demo of textbox: Classic box" gnexp = ("This is a demo of the classic textbox call, " "you can see it closes when ok is pressed.\n\n") challenge = "INSERT A TEXT WITH MORE THAN TWO PARAGRAPHS" text = "Insert your text here\n" msg = gnexp + challenge finished = False while True: text = textbox(msg, title, text) escaped = not text if escaped or finished: break if text.count("\n") >= 2: msg = (u"You did it right! Press OK") finished = True else: msg = u"You did it wrong! Try again!\n" + challenge class Demo2(object): """ Program that challenges the user to write 5 a's """ def __init__(self): """ Set and run the program """ title = "Demo of textbox: Classic box with callback" gnexp = ("This is a demo of the textbox with a callback, " "it doesn't flicker!.\n\n") msg = "INSERT A TEXT WITH FIVE OR MORE A\'s" text_snippet = "Insert your text here" self.finished = False textbox(gnexp + msg, title, text_snippet, False, callback=self.check_answer, run=True) def check_answer(self, box): """ Callback from TextBox Parameters ----------- box: object object containing parameters and methods to communicate with the ui Returns ------- nothing: its return is through the box object """ if self.finished: box.stop() if box.text.lower().count("a") >= 5: box.msg = u"\n\nYou did it right! Press OK button to continue." box.stop() self.finished else: box.msg = u"\n\nMore a's are needed!" class Demo3(object): """ Program that challenges the user to find a typo """ def __init__(self): """ Set and run the program """ self.finished = False title = "Demo of textbox: Object with callback" msg = ("This is a demo of the textbox set as " "an object with a callback, " "you can configure it and when you are finished, " "you run it.\n\nThere is a typo in it. Find and correct it.") text_snippet = "Hello" # This text wont show box = textbox( msg, title, text_snippet, False, callback=self.check_answer, run=False) box.text = ( "It was the west of times, and it was the worst of times. " "The rich ate cake, and the poor had cake recommended to them, " "but wished only for enough cash to buy bread." "The time was ripe for revolution! ") box.run() def check_answer(self, box): """ Callback from TextBox Parameters ---------- box: object object containing parameters and methods to communicate with the ui Returns ------- nothing: its return is through the box object """ if self.finished: box.stop() if "best" in box.text: box.msg = u"\n\nYou did right! Press OK button to continue." self.finished = True else: box.msg = u"\n\nLook to the west!" def textbox(msg="", title=" ", text="", codebox=False, callback=None, run=True): """Displays a dialog box with a large, multi-line text box, and returns the entered text as a string. The message text is displayed in a proportional font and wraps. Parameters ---------- msg : string text displayed in the message area (instructions...) title : str the window title text: str, list or tuple text displayed in textAreas (editable) codebox: bool if True, don't wrap and width is set to 80 chars callback: function if set, this function will be called when OK is pressed run: bool if True, a box object will be created and returned, but not run Returns ------- None If cancel is pressed str If OK is pressed returns the contents of textArea """ tb = TextBox(msg=msg, title=title, text=text, codebox=codebox, callback=callback) if not run: return tb else: reply = tb.run() return reply class TextBox(object): """ Display a message and a text to edit This object separates user from ui, defines which methods can the user invoke and which properties can he change. It also calls the ui in defined ways, so if other gui library can be used (wx, qt) without breaking anything for the user. """ def __init__(self, msg, title, text, codebox, callback=lambda *args, **kwargs: True): """ Create box object Parameters ---------- msg : string text displayed in the message area (instructions...) title : str the window title text: str, list or tuple text displayed in textAres (editable) codebox: bool if True, don't wrap and width is set to 80 chars callback: function if set, this function will be called when OK is pressed Returns ------- object The box object """ self.callback = callback self.ui = GUItk(msg, title, text, codebox, self.callback_ui) self.text = text def run(self): """ Start the ui """ self.ui.run() self.ui = None return self._text def stop(self): """ Stop the ui """ self.ui.stop() def callback_ui(self, ui, command, text): """ This method is executed when ok, cancel, or x is pressed in the ui. """ if command == 'update': # OK was pressed self._text = text if self.callback: # If a callback was set, call main process self.callback(self) else: self.stop() elif command == 'x': self.stop() self._text = None elif command == 'cancel': self.stop() self._text = None # methods to change properties -------------- @property def text(self): """Text in text Area""" return self._text @text.setter def text(self, text): self._text = self.to_string(text) self.ui.set_text(self._text) @text.deleter def text(self): self._text = "" self.ui.set_text(self._text) @property def msg(self): """Text in msg Area""" return self._msg @msg.setter def msg(self, msg): self._msg = self.to_string(msg) self.ui.set_msg(self._msg) @msg.deleter def msg(self): self._msg = "" self.ui.set_msg(self._msg) # Methods to validate what will be sent to ui --------- def to_string(self, something): try: basestring # python 2 except NameError: basestring = str # Python 3 if isinstance(something, basestring): return something try: text = "".join(something) # convert a list or a tuple to a string except: textbox( "Exception when trying to convert {} to text in self.textArea" .format(type(something))) sys.exit(16) return text class GUItk(object): """ This is the object that contains the tk root object""" def __init__(self, msg, title, text, codebox, callback): """ Create ui object Parameters ---------- msg : string text displayed in the message area (instructions...) title : str the window title text: str, list or tuple text displayed in textAres (editable) codebox: bool if True, don't wrap, and width is set to 80 chars callback: function if set, this function will be called when OK is pressed Returns ------- object The ui object """ self.callback = callback self.boxRoot = tk.Tk() # self.boxFont = tk_Font.Font( # family=global_state.PROPORTIONAL_FONT_FAMILY, # size=global_state.PROPORTIONAL_FONT_SIZE) wrap_text = not codebox if wrap_text: self.boxFont = tk_Font.nametofont("TkTextFont") self.width_in_chars = global_state.prop_font_line_length else: self.boxFont = tk_Font.nametofont("TkFixedFont") self.width_in_chars = global_state.fixw_font_line_length # default_font.configure(size=global_state.PROPORTIONAL_FONT_SIZE) self.configure_root(title) self.create_msg_widget(msg) self.create_text_area(wrap_text) self.create_buttons_frame() self.create_cancel_button() self.create_ok_button() # Run and stop methods --------------------------------------- def run(self): self.boxRoot.mainloop() self.boxRoot.destroy() def stop(self): # Get the current position before quitting self.get_pos() self.boxRoot.quit() # Methods to change content --------------------------------------- def set_msg(self, msg): self.messageArea.config(state=tk.NORMAL) self.messageArea.delete(1.0, tk.END) self.messageArea.insert(tk.END, msg) self.messageArea.config(state=tk.DISABLED) # Adjust msg height self.messageArea.update() numlines = self.get_num_lines(self.messageArea) self.set_msg_height(numlines) self.messageArea.update() def set_msg_height(self, numlines): self.messageArea.configure(height=numlines) def get_num_lines(self, widget): end_position = widget.index(tk.END) # '4.0' end_line = end_position.split('.')[0] # 4 return int(end_line) # 5 def set_text(self, text): self.textArea.delete(1.0, tk.END) self.textArea.insert(tk.END, text, "normal") self.textArea.focus() def set_pos(self, pos): self.boxRoot.geometry(pos) def get_pos(self): # The geometry() method sets a size for the window and positions it on # the screen. The first two parameters are width and height of # the window. The last two parameters are x and y screen coordinates. # geometry("250x150+300+300") geom = self.boxRoot.geometry() # "628x672+300+200" global_state.window_position = '+' + geom.split('+', 1)[1] def get_text(self): return self.textArea.get(0.0, 'end-1c') # Methods executing when a key is pressed ------------------------------- def x_pressed(self): self.callback(self, command='x', text=self.get_text()) def cancel_pressed(self, event): self.callback(self, command='cancel', text=self.get_text()) def ok_button_pressed(self, event): self.callback(self, command='update', text=self.get_text()) # Auxiliary methods ----------------------------------------------- def calc_character_width(self): char_width = self.boxFont.measure('W') return char_width # Initial configuration methods --------------------------------------- # These ones are just called once, at setting. def configure_root(self, title): self.boxRoot.title(title) self.set_pos(global_state.window_position) # Quit when x button pressed self.boxRoot.protocol('WM_DELETE_WINDOW', self.x_pressed) self.boxRoot.bind("", self.cancel_pressed) self.boxRoot.iconname('Dialog') self.boxRoot.attributes("-topmost", True) # Put the dialog box in focus. def create_msg_widget(self, msg): if msg is None: msg = "" self.msgFrame = tk.Frame( self.boxRoot, padx=1.25 * self.calc_character_width(), ) self.messageArea = tk.Text( self.msgFrame, width=self.width_in_chars, state=tk.DISABLED, padx=(global_state.default_hpad_in_chars) * self.calc_character_width(), pady=self.calc_character_width(), wrap=tk.WORD, ) self.set_msg(msg) self.msgFrame.pack(fill='x') self.messageArea.pack(fill='x') def create_text_area(self, wrap_text): """ Put a textArea in the top frame Put and configure scrollbars """ self.textFrame = tk.Frame( self.boxRoot, padx=1.25 * self.calc_character_width(), ) self.textFrame.pack(side=tk.TOP) # self.textFrame.grid(row=1, column=0, sticky=tk.EW) self.textArea = tk.Text( self.textFrame, padx=global_state.default_hpad_in_chars * self.calc_character_width(), pady=global_state.default_hpad_in_chars * self.calc_character_width(), height=25, # lines. Note: a user-set arg would be preferable to hardcoded value width=self.width_in_chars, # chars of the current font ) if wrap_text: self.textArea.configure(wrap=tk.WORD) else: self.textArea.configure(wrap=tk.NONE) # some simple keybindings for scrolling self.boxRoot.bind("", self.textArea.yview_scroll(1, tk.PAGES)) self.boxRoot.bind( "", self.textArea.yview_scroll(-1, tk.PAGES)) self.boxRoot.bind("", self.textArea.xview_scroll(1, tk.PAGES)) self.boxRoot.bind("", self.textArea.xview_scroll(-1, tk.PAGES)) self.boxRoot.bind("", self.textArea.yview_scroll(1, tk.UNITS)) self.boxRoot.bind("", self.textArea.yview_scroll(-1, tk.UNITS)) # add a vertical scrollbar to the frame rightScrollbar = tk.Scrollbar( self.textFrame, orient=tk.VERTICAL, command=self.textArea.yview) self.textArea.configure(yscrollcommand=rightScrollbar.set) # add a horizontal scrollbar to the frame bottomScrollbar = tk.Scrollbar( self.textFrame, orient=tk.HORIZONTAL, command=self.textArea.xview) self.textArea.configure(xscrollcommand=bottomScrollbar.set) # pack the textArea and the scrollbars. Note that although # we must define the textArea first, we must pack it last, # so that the bottomScrollbar will be located properly. # Note that we need a bottom scrollbar only for code. # Text will be displayed with wordwrap, so we don't need to have # a horizontal scroll for it. if not wrap_text: bottomScrollbar.pack(side=tk.BOTTOM, fill=tk.X) rightScrollbar.pack(side=tk.RIGHT, fill=tk.Y) self.textArea.pack(side=tk.LEFT, fill=tk.BOTH, expand=tk.YES) def create_buttons_frame(self): self.buttonsFrame = tk.Frame(self.boxRoot, # background="green", ) self.buttonsFrame.pack(side=tk.TOP) def create_cancel_button(self): # put the buttons in the buttonsFrame self.cancelButton = tk.Button( self.buttonsFrame, takefocus=tk.YES, text="Cancel", height=1, width=6) self.cancelButton.pack( expand=tk.NO, side=tk.LEFT, padx='2m', pady='1m', ipady="1m", ipadx="2m") # for the commandButton, bind activation events to the activation event # handler self.cancelButton.bind("", self.cancel_pressed) self.cancelButton.bind("", self.cancel_pressed) self.cancelButton.bind("", self.cancel_pressed) def create_ok_button(self): # put the buttons in the buttonsFrame self.okButton = tk.Button( self.buttonsFrame, takefocus=tk.YES, text="OK", height=1, width=6) self.okButton.pack( expand=tk.NO, side=tk.LEFT, padx='2m', pady='1m', ipady="1m", ipadx="2m") # for the commandButton, bind activation events to the activation event # handler self.okButton.bind("", self.ok_button_pressed) self.okButton.bind("", self.ok_button_pressed) if __name__ == '__main__': demo_textbox() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/boxes/utils.py0000666000000000000000000001530600000000000014461 0ustar00""" .. moduleauthor:: easygui developers and Stephen Raymond Ferg .. default-domain:: py .. highlight:: python Version |release| """ import os import sys import traceback # A set of variables and functions to centralize differences between # python 2 and 3 runningPython27 = False runningPython34 = False if 0x020700F0 <= sys.hexversion <= 0x030000F0: runningPython27 = True if 0x030400F0 <= sys.hexversion <= 0x040000F0: runningPython34 = True if not runningPython27 and not runningPython34: raise Exception("You must run on Python 2.7+ or Python 3.4+") # Import Tkinter, the tk filedialog, and put everything in tkinter into # the current namespace try: import tkinter as tk # python3 # TODO: Ultimately this should go away once everything stops using it. from tkinter import * import tkinter.filedialog as tk_FileDialog import tkinter.font as tk_Font except ImportError: try: import Tkinter as tk # python2 # TODO: Ultimately this should go away once everything stops using it. from Tkinter import * import tkFileDialog as tk_FileDialog import tkFont as tk_Font except ImportError: raise ImportError("Unable to find tkinter package.") if tk.TkVersion < 8.0: raise ImportError("You must use python-tk (tkinter) version 8.0 or higher") # Try to import the Python Image Library. If it doesn't exist, only .gif # images are supported. try: from PIL import Image as PILImage from PIL import ImageTk as PILImageTk except: pass # Code should use 'basestring' anywhere you might think to use the system 'str'. This is all to support # Python 2. If 2 ever goes away, this logic can go away and uses of # utils.basestring should be changed to just str if runningPython27: basestring = basestring if runningPython34: basestring = str # ----------------------------------------------------------------------- # exception_format # ----------------------------------------------------------------------- def exception_format(): """ Convert exception info into a string suitable for display. """ return "".join(traceback.format_exception( sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2] )) # ------------------------------------------------------------------- # utility routines # ------------------------------------------------------------------- # These routines are used by several other functions in the EasyGui module. def uniquify_list_of_strings(input_list): """ Ensure that every string within input_list is unique. :param list input_list: List of strings :return: New list with unique names as needed. """ output_list = list() for i, item in enumerate(input_list): tempList = input_list[:i] + input_list[i + 1:] if item not in tempList: output_list.append(item) else: output_list.append('{0}_{1}'.format(item, i)) return output_list import re def parse_hotkey(text): """ Extract a desired hotkey from the text. The format to enclose the hotkey in square braces as in Button_[1] which would assign the keyboard key 1 to that button. The one will be included in the button text. To hide they key, use double square braces as in: Ex[[qq]] it , which would assign the q key to the Exit button. Special keys such as may also be used: Move [] for a full list of special keys, see this reference: http://infohoglobal_state.nmt.edu/tcc/help/ pubs/tkinter/web/key-names.html :param text: :return: list containing cleaned text, hotkey, and hotkey position within cleaned text. """ ret_val = [text, None, None] # Default return values if text is None: return ret_val # Single character, remain visible res = re.search(r'(?<=\[).(?=\])', text) if res: start = res.start(0) end = res.end(0) caption = text[:start - 1] + text[start:end] + text[end + 1:] ret_val = [caption, text[start:end], start - 1] # Single character, hide it res = re.search(r'(?<=\[\[).(?=\]\])', text) if res: start = res.start(0) end = res.end(0) caption = text[:start - 2] + text[end + 2:] ret_val = [caption, text[start:end], None] # a Keysym. Always hide it res = re.search(r'(?<=\[\<).+(?=\>\])', text) if res: start = res.start(0) end = res.end(0) caption = text[:start - 2] + text[end + 2:] ret_val = [caption, '<{}>'.format(text[start:end]), None] return ret_val def load_tk_image(filename, tk_master=None): """ Load in an image file and return as a tk Image. Loads an image. If the PIL library is available use it. otherwise use the tk method. NOTE: tk_master is required if there are more than one Tk() instances, which there are very often. REF: http://stackoverflow.com/a/23229091/2184122 :param filename: image filename to load :param tk_master: root object (Tk()) :return: tk Image object """ if filename is None: return None if not os.path.isfile(filename): raise ValueError( 'Image file {} does not exist.'.format(filename)) tk_image = None filename = os.path.normpath(filename) _, ext = os.path.splitext(filename) try: pil_image = PILImage.open(filename) tk_image = PILImageTk.PhotoImage(pil_image, master=tk_master) except: try: # Fallback if PIL isn't available tk_image = tk.PhotoImage(file=filename, master=tk_master) except: msg = "Cannot load {}. Check to make sure it is an image file.".format( filename) try: _ = PILImage except: msg += "\nPIL library isn't installed. If it isn't installed, only .gif files can be used." raise ValueError(msg) return tk_image # ------------------------------------------------------------------- # getFileDialogTitle # ------------------------------------------------------------------- def getFileDialogTitle(msg, title): """ Create nicely-formatted string based on arguments msg and title :param msg: the msg to be displayed :param title: the window title :return: None """ if msg and title: return "%s - %s" % (title, msg) if msg and not title: return str(msg) if title and not msg: return str(title) return None # no message and no title if __name__ == '__main__': print("Hello from utils") ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648571507.0 easygui-0.98.3/easygui/easygui.py0000666000000000000000000000654100000000000013650 0ustar00""" .. moduleauthor:: easygui developers and Stephen Raymond Ferg .. default-domain:: py .. highlight:: python Version |release| ABOUT EASYGUI ============= EasyGUI provides an easy-to-use interface for simple GUI interaction with a user. It does not require the programmer to know anything about tkinter, frames, widgets, callbacks or lambda. All GUI interactions are invoked by simple function calls that return results. .. warning:: Using EasyGUI with IDLE You may encounter problems using IDLE to run programs that use EasyGUI. Try it and find out. EasyGUI is a collection of Tkinter routines that run their own event loops. IDLE is also a Tkinter application, with its own event loop. The two may conflict, with unpredictable results. If you find that you have problems, try running your EasyGUI program outside of IDLE. .. note:: EasyGUI requires Tk release 8.0 or greater. LICENSE INFORMATION =================== EasyGUI version |version| Copyright (c) 2014, Stephen Raymond Ferg All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ABOUT THE EASYGUI LICENSE ------------------------- | This license is what is generally known as the "modified BSD license", | aka "revised BSD", "new BSD", "3-clause BSD". | See http://www.opensource.org/licenses/bsd-license.php | | This license is GPL-compatible. | See ``_ | See http://www.gnu.org/licenses/license-liglobal_state.html#GPLCompatibleLicenses | | The BSD License is less restrictive than GPL. | It allows software released under the license to be incorporated into proprietary products. | Works based on the software may be released under a proprietary license or as closed source software. | ``_ API === """ if __name__ == '__main__': from boxes.demo import easygui_demo easygui_demo() # from boxes.alt_text_box import demo_textbox # demo_textbox() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/python_and_check_logo.gif0000666000000000000000000006103000000000000016631 0ustar00GIF89aaa   ,U4D U }    (q 0(y( < (  Py88  ]@ 8 iH  qP0 yY<,$L H(L 8<,$ (0]$ ((P H( 0 8m (8Li0 ,}40$$8} < 4$,$((4((@8 4 <,,@,0,D<(4(<,,00@DL D H44H0<04<4U88HPD88U<P9f2DdڴN&D~X5 `8g D<>d@Czt@*,U ǘ"g:>@ZeF~ј~u 46~31UGl;UD*tXdiߦ$X q7"LUQ5,CX Gs#X%J؀U`gR>ixxU L)J@UEg8>`:sM.r2#4'R=SbCcD)K)p(I>@Fbu]`JC\A7g5gP8>gTyL&RB<2HhXE 6rF*N2*PD-x81Ag0!˜e&(FJ3LT'ĤZXdF|1( M1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 \~* hF`,0" ftbMT% ,kB<nL3/+3~ amWZBа8;mh/f ³`x WW*6+U-\"pDV7բzABF*y'E5RGe|ERHTR# btSaF#R/-%FjlZu4/+aP7KzB #Xrb䱍ZƤr=\ ,EBx d"PI1LCT;:<-ff {-TkMdyNl!@A 4]J K=Jyle͗Acod%z+wsΉͺ.)Fwڿ MXy^:ܫz4H/˓:H)'u'PvJz+L%s,襍Pe  GL#u>R5ZOn'#fJ#8>Rۋ}[yeJ)tY8Ǟ⊃wFbP"!ڳ$\{{7 6dTp޾sFEѓ n)v ]ib≤+*P' )S*W#cH\GJE[SL0ͦa*)M$J ~r#°G@!#B{A2kUD{Xd!Np C.M9%fXr{o)6hŚ6Em6_`\?<׵zNkiLDg$&iwNRU!XFChY CZWLuh\P*=C%kd{ӼZO!:$7d& 3t7]s|{1t[ץҒTM(tIX 3]k-=6r>.9%O 5JK(B i ,$IwO MEgN(g/9׭v CA nEͺ`;:?~Zgφl :B5LO|dHAT9;-q+Qv9*:֏MCv؀?/B" T\1.MD_];t â(lpge+;!~Љˮ774y <ǚЩ 㰃mb~K9Rohc 7gQuV&n Ddm$NX4?]#T CX u}}Sj@]25$2y<^V]d|=KU/VG/}m.֝:-"ѧ9dnQy_K=?\5HM3kZAwg%&hV e6J]Vp%ugYޕՙ8) H+UG!E%|4_ I̦ ?MrhN9CB. !?RLj#9@Ykٝ^V @RLBTcTNE)ٚ Vkwj?@DP/d).#­ ҋE\>rߔ ÐR-W_2pـGslN- f B_φofa _~rbos4O|—]9/ulvcMY&>,6Nh+9K|l6@ =Yxhvc y|YA zk E6m/z瀒13ЃzY7-@ǣE<韜fL-4Y jR䶡ZVqٗTa;ڟW[U2,˫mMo~}xAAAF/-(IENDB`././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648567478.0 easygui-0.98.3/easygui/zzzzz.gif0000666000000000000000000000324700000000000013540 0ustar00GIF89aco3f++3+f+++UU3UfUUU3f3f3fՙ3f3333f3333+3+33+f3+3+3+3U3U33Uf3U3U3U3333f3333333f3333333f3ՙ333333f333ff3ffffff+f+3f+ff+f+f+fUfU3fUffUfUfUff3fffffff3fffffff3fffՙffff3fffff3f̙++3+f++̙+UU3UfUU̙U3f̙3f̙3fՙ̙3f̙3f++3+f+++UU3UfUUÙ̀3̀f̪̪̀̀̀3̪f̪̪̪3fՙ3f3f++3+f+++UU3UfUUU3f3f3fՙ3f!,co H*\ȰÇ#JHŋ3jȱǏ CIɓ(S\ɲ˗0cʜI͛8sɳϟ@ JѣH*]ʴӧPJJիXjݪ54mz+k؅c*LK14lӲr i*Woū_u;o/N1diy){ be5緀]eiύWhmլK;-X4e<>yRqTMCIn/ӫ dw[v=asW7=}{qBN3`B<)ttAfcBn8_raF޼/ y4)"`-&" ͊1j_#c"#GsreSM7Υ MNRBY5[y+`$et& yӛ*=dmu t'ly W5}N4Oh!v(:!.5;:F&ppe\xeljb*ja\"V6V.8W\bx,.lFXօ樽]i ԜNdh}-S>> import easygui >>> easygui.ynbox('Shall I continue?', 'Title', ('Yes', 'No')) 1 >>> easygui.msgbox('This is a basic message box.', 'Title Goes Here') 'OK' >>> easygui.buttonbox('Click on your favorite flavor.', 'Favorite Flavor', ('Chocolate', 'Vanilla', 'Strawberry')) 'Chocolate' To see demo programs using EasyGUI, call the `easygui.egdemo()` function. Full documentation is always available. For the most-recent production version: . For our develop version which will be released next: . 0.98.3 ======================================================================== Update collections.abc import location (old location was deprecated since version 3.3, removed in version 3.10) See: https://docs.python.org/3.9/library/collections.html#module-collections for details Add some unit test coverage and test automation for TravisCI. 0.98.2 ======================================================================== Several updates and fixes thanks to Al and others. 0.98.0 ======================================================================== This is an exciting time for easygui. We continue to make good progress with refactoring as well as some enhancements and bug fixes here and there. We would like to welcome Juanjo Denis-Corrales to the team. He is responsible for lots of good new work this release. Of course we appreciate the work of everyone who contributed. NOTE: I decided in this release to change the API a bit. Please consult the function documentation for details. BUG FIXES --------- * Made changes guessing at fixes to any IDLE problems. Please report any problems found. ENHANCEMENTS ------------ * Refactored the easygui.py file into several smaller files to improve our ability to manage the code * Added callbacks to allow for more dynamic dialogs. See the docs for usage. * Added class access to dialogs so properties may be changed. KNOWN ISSUES ------------ * There were previous issues when using easygui with the IDLE IDE. I hope I resolved these problems, however, I've never actually been able to repeat them. Please report any problems found in github. OTHER CHANGES ------------- * Centralized the Python 2 versus Python 3 "compatibility layer" into boxes/utils.py 0.97.4 ======================================================================== This is a minor bug-fix release to address python 3 import errors. 0.97.3 ======================================================================== We are happy to release version 0.97.3 of easygui. The intent of this release is to address some basic functionality issues as well as improve easygui in the ways people have asked. Robert Lugg (me) was searching for a GUI library for my python work. I saw easygui and liked very much its paradigm. Stephen Ferg, the creator and developer of easygui, graciously allowed me to start development back up. With the help of Alexander Zawadzki, Horst Jens, and others I set a goal to release before the end of 2014. We rely on user feedback so please bring up problems, ideas, or just say how you are using easygui. BUG FIXES --------- * sourceforge #4: easygui docs contain bad references to easygui_pydoc.html * sourceforge #6: no index.html in docs download file. Updated to sphinx which as autolinking. * sourceforge #8: unicode issues with file*box. Fixed all that I knew how. * sourceforge #12: Cannot Exit with 'X'. Now X and escape either return "cancel_button", if set, or None ENHANCEMENTS ------------ * Added ability to specify default_choice and cancel_choice for button widgets (See API docs) * True and False are returned instead of 1 and 0 for several boxes * Allow user to map keyboard keys to buttons by enclosing a hotkey in square braces like: "Pick [M]e", which would assign keyboard key M to that button. Double braces hide that character, and keysyms are allowed: [[q]]Exit Would show Exit on the button, and the button would be controlled by the q key []Help Would show Help on the button, and the button would be controlled by the F1 function key NOTE: We are still working on the exact syntax of these key mappings as Enter, space, and arrows are already being used. * Escape and the windows 'X' button always work in buttonboxes. Those return None in that case. * sourceforge #9: let fileopenbox open multiple files. Added optional argument 'multiple' * Location of dialogs on screen is preserved. This isn't perfect yet, but now, at least, the dialogs don't always reset to their default position! * added some, but not all of the bugs/enhancements developed by Robbie Brook: http://all-you-need-is-tech.blogspot.com/2013/01/improving-easygui-for-python.html KNOWN ISSUES ------------ * In the documentation, there were previous references to issues when using the IDLE IDE. I haven't experienced those, but also didn't do anything to fix them, so they may still be there. Please report any problems and we'll try to address them * I am fairly new to contributing to open source, so I don't understand packaging, pypi, etc. There are likely problems as well as better ways to do things. Again, I appreciate any help or guidance. Other Changes (that you likely don't care about) ------------------------------------------------ * Restructured loading of image files to try PIL first throw error if file doesn't exist. * Converted docs to sphinx with just a bit of doctest. Most content was retained from the old site, so there might be some redundancies still. Please make any suggested improvements. * Set up a GitHub repository for development: https://github.com/robertlugg/easygui * Improved output/packaging for Debian distribution EasyGui is licensed under what is generally known as the "modified BSD license" (aka "revised BSD", "new BSD", "3-clause BSD"). This license is GPL-compatible but less restrictive than GPL. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648817217.0 easygui-0.98.3/easygui.egg-info/SOURCES.txt0000666000000000000000000000153100000000000015200 0ustar00LICENSE MANIFEST.in README.md README.txt setup.cfg setup.py easygui/__init__.py easygui/__main__.py easygui/easygui.py easygui/python_and_check_logo.gif easygui/python_and_check_logo.jpg easygui/python_and_check_logo.png easygui/zzzzz.gif easygui.egg-info/PKG-INFO easygui.egg-info/SOURCES.txt easygui.egg-info/dependency_links.txt easygui.egg-info/top_level.txt easygui/boxes/__init__.py easygui/boxes/about.py easygui/boxes/base_boxes.py easygui/boxes/button_box.py easygui/boxes/choice_box.py easygui/boxes/demo.py easygui/boxes/derived_boxes.py easygui/boxes/diropen_box.py easygui/boxes/egstore.py easygui/boxes/fileboxsetup.py easygui/boxes/fileopen_box.py easygui/boxes/filesave_box.py easygui/boxes/fillable_box.py easygui/boxes/global_state.py easygui/boxes/multi_fillable_box.py easygui/boxes/text_box.py easygui/boxes/utils.py test/test_travis.py././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648817217.0 easygui-0.98.3/easygui.egg-info/dependency_links.txt0000666000000000000000000000000100000000000017362 0ustar00 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648817217.0 easygui-0.98.3/easygui.egg-info/top_level.txt0000666000000000000000000000001000000000000016035 0ustar00easygui ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648817217.7610354 easygui-0.98.3/setup.cfg0000666000000000000000000000011200000000000011767 0ustar00[bdist_wheel] universal = 1 [egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648817194.0 easygui-0.98.3/setup.py0000666000000000000000000000367700000000000011703 0ustar00import distutils.core ## WARNING: Although the following import appears to do nothing, it is required for bdist_wheel to be recognized from setuptools import setup, find_packages version = "0.98.3" release = "0.98.3" desc = list() desc.append('EasyGUI is a module for very simple, very easy GUI programming in Python. ') desc.append('EasyGUI is different from other GUI generators in that EasyGUI is NOT event-driven. ') desc.append('Instead, all GUI interactions are invoked by simple function calls.') with open('README.md', "r", encoding='utf-8') as f: long_description = f.read() distutils.core.setup( name='easygui', version=version, url='https://github.com/robertlugg/easygui', description=''.join(desc), long_description=long_description, long_description_content_type="text/markdown", author='easygui developers and Stephen Ferg', author_email='robert.lugg@gmail.com', license='BSD', keywords='gui linux windows graphical user interface', packages=['easygui', 'easygui.boxes'], package_data={ 'easygui': ['python_and_check_logo.*', 'zzzzz.gif'] }, classifiers=[ 'Intended Audience :: Developers', 'Intended Audience :: Education', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Topic :: Software Development :: User Interfaces', ] ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648817217.7610354 easygui-0.98.3/test/0000777000000000000000000000000000000000000011133 5ustar00././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648814214.0 easygui-0.98.3/test/test_travis.py0000666000000000000000000000015700000000000014057 0ustar00def test_always_passes(): assert True # @staticmethod # def test_always_fails(): # assert False