mishaturnbull / EmailGUI

Stress-test an email server.
https://mishaturnbull.github.io/EmailGUI/index.html
MIT License
0 stars 0 forks source link

Progress bar does not scale down #28

Closed mishaturnbull closed 6 years ago

mishaturnbull commented 6 years ago

When sending less than 10 emails, the progress bar's maximum value remains at 10 and results in behavior such that when complete, the bar does not indicate completion. For example, sending three emails results in a bar that looks like:

+--------------------------------+
| xxxxxxxx                       |
+--------------------------------+

whereas it should indicate:

+--------------------------------+
| xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
+--------------------------------+
mishaturnbull commented 6 years ago

The bar's maximum value update is currently handled on line 68 of gui_callbacks.py:

def handle_send(coordinator):
    """Send the emails."""
    coordinator.gui.bar['maximum'] = coordinator.settings['amount']  ### line 68, pbar update
    msg = '\n'.join(coordinator.settings['confirmation_msg'])
    coordinator.gui.root.grab_set()
    mboxres = messagebox.askyesno("Confirmation", msg)
    if mboxres:
        coordinator.send()