robertlugg / easygui

easygui for Python
http://easygui.readthedocs.org/en/master/
BSD 3-Clause "New" or "Revised" License
451 stars 114 forks source link

Initial refactor and tests of the text_box class (and derived classes) #202

Open zadacka opened 2 years ago

zadacka commented 2 years ago

First of a series of proposed commits to simplify, reduce duplication, and add testing to box classes

zadacka commented 2 years ago

A few things to discuss here, I think.

Proposing to move many of the 'demo' functions to a demo class so that the code files can be pure implementation. Proposing to settle on Tk as the windowing tool, and strip out the UI intermediate layer - we are pretty settled on Tk...

If this looks good, I've got some (local) commits to do a similar refactor for other box classes.

The imports and usage of the methods should all be staying the same here: due to the way that we set the easygui.__init__.py __all__ we should still be able to import textbox, codebox, and exceptionbox in the same way as before.

zadacka commented 2 years ago

I think that is the main refactor done. Most boxes now inherit from an AbstractBox which allows for a good amount of code re-use.

Things that I'd like to do pre-merge:

  1. go through each type of box and compare before-and-after screenshots (padding changes etc might be nasty)
  2. list the breaking changes (there are a handful of them ... which I think are worthwhile ... but should be clear and explicit(
  3. test out the demos to confirm that I've not broken any sensible use cases ... and then merge this to master.

Once the refactor lands, then I think that we can do some tidying up of the docs and finally make some headway on the open issues / bugs / feature requests that have been stacking up.