one_line_progress_meter - key parameter now defaults. No need to specify if you have only ONE meter going.

This commit is contained in:
PySimpleGUI 2020-06-23 06:08:13 -04:00
parent bf9b702770
commit 8a86b566ef
4 changed files with 13 additions and 13 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 #!/usr/bin/python3
version = __version__ = "4.20.0.8 Unreleased\n Ability to add your own theme easier using theme_add_new, VSeparator added (spelling error), removed Radio update clearing all if one is cleared (forgot about reset_group), new Element.set_vscroll_position method, added initial_folder to popup_get_folder and default_path to no_window version of popup_get_file, HorizontalSeparator (FINALLY), added keys to separators, added color parameter to Separators (defaults to theme text color), docstring for Window.get_screen_size" version = __version__ = "4.20.0.9 Unreleased\n Ability to add your own theme easier using theme_add_new, VSeparator added (spelling error), removed Radio update clearing all if one is cleared (forgot about reset_group), new Element.set_vscroll_position method, added initial_folder to popup_get_folder and default_path to no_window version of popup_get_file, HorizontalSeparator (FINALLY), added keys to separators, added color parameter to Separators (defaults to theme text color), docstring for Window.get_screen_size, added default key for one_line_progress_meter"
port = 'PySimpleGUI' port = 'PySimpleGUI'
@ -11677,7 +11677,7 @@ class QuickMeter(object):
return self.stat_messages return self.stat_messages
def OneLineProgressMeter(title, current_value, max_value, key, *args, orientation='v', bar_color=(None, None), button_color=None, size=DEFAULT_PROGRESS_BAR_SIZE, border_width=None, grab_anywhere=False, no_titlebar=False): def OneLineProgressMeter(title, current_value, max_value, key='OK for 1 meter', *args, orientation='v', bar_color=(None, None), button_color=None, size=DEFAULT_PROGRESS_BAR_SIZE, border_width=None, grab_anywhere=False, no_titlebar=False):
""" """
:param title: text to display in eleemnt :param title: text to display in eleemnt
:type title: (str) :type title: (str)
@ -11685,7 +11685,7 @@ def OneLineProgressMeter(title, current_value, max_value, key, *args, orientatio
:type current_value: (int) :type current_value: (int)
:param max_value: max value of QuickMeter :param max_value: max value of QuickMeter
:type max_value: (int) :type max_value: (int)
:param key: Used with window.FindElement and with return values to uniquely identify this element :param key: Used to differentiate between mutliple meters. Used to cancel meter early. Now optional as there is a default value for single meters
:type key: Union[str, int, tuple] :type key: Union[str, int, tuple]
:param *args: stuff to output :param *args: stuff to output
:type *args: (Any) :type *args: (Any)
@ -11717,7 +11717,7 @@ def OneLineProgressMeter(title, current_value, max_value, key, *args, orientatio
return rc == METER_OK return rc == METER_OK
def OneLineProgressMeterCancel(key): def OneLineProgressMeterCancel(key='OK for 1 meter'):
""" """
Cancels and closes a previously created One Line Progress Meter window Cancels and closes a previously created One Line Progress Meter window

View File

@ -1,5 +1,5 @@
#!/usr/bin/python3 #!/usr/bin/python3
version = __version__ = "0.35.0.4 Unreleased\nMassive update of docstrings (thanks nngogol), default for slider tick interval set automatically now, margins added to Window but not yet hooked up, VSeparator added (spelling error), added Radio.reset_group and removed clearing all when one of them is cleared (recent change)" version = __version__ = "0.35.0.5 Unreleased\nMassive update of docstrings (thanks nngogol), default for slider tick interval set automatically now, margins added to Window but not yet hooked up, VSeparator added (spelling error), added Radio.reset_group and removed clearing all when one of them is cleared (recent change), added default key for one_line_progress_meter"
port = 'PySimpleGUIQt' port = 'PySimpleGUIQt'
@ -7034,7 +7034,7 @@ class QuickMeter(object):
return self.stat_messages return self.stat_messages
def OneLineProgressMeter(title, current_value, max_value, key, *args, orientation='v', bar_color=(None, None), def OneLineProgressMeter(title, current_value, max_value, key='OK for 1 meter', *args, orientation='v', bar_color=(None, None),
button_color=None, size=DEFAULT_PROGRESS_BAR_SIZE, border_width=None, grab_anywhere=False): button_color=None, size=DEFAULT_PROGRESS_BAR_SIZE, border_width=None, grab_anywhere=False):
""" """
:param orientation: 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical' / 'v') :param orientation: 'horizontal' or 'vertical' ('h' or 'v' work) (Default value = 'vertical' / 'v')
@ -7063,7 +7063,7 @@ def OneLineProgressMeter(title, current_value, max_value, key, *args, orientatio
OneLineProgressMeter.exit_reasons = getattr(OneLineProgressMeter,'exit_reasons', QuickMeter.exit_reasons) OneLineProgressMeter.exit_reasons = getattr(OneLineProgressMeter,'exit_reasons', QuickMeter.exit_reasons)
return rc == METER_OK return rc == METER_OK
def OneLineProgressMeterCancel(key): def OneLineProgressMeterCancel(key='OK for 1 meter'):
try: try:
meter = QuickMeter.active_meters[key] meter = QuickMeter.active_meters[key]
meter.window.Close() meter.window.Close()

View File

@ -1,6 +1,6 @@
#usr/bin/python3 #usr/bin/python3
version = __version__ = "0.39.0.1 Unreleased\n , VSeparator added (spelling error)" version = __version__ = "0.39.0.2 Unreleased\n , VSeparator added (spelling error), added default key for one_line_progress_meter"
port = 'PySimpleGUIWeb' port = 'PySimpleGUIWeb'
@ -5554,7 +5554,7 @@ _one_line_progress_meters = {}
# ============================== OneLineProgressMeter =====# # ============================== OneLineProgressMeter =====#
def OneLineProgressMeter(title, current_value, max_value, key, *args, orientation=None, bar_color=(None, None), def OneLineProgressMeter(title, current_value, max_value, key='OK for 1 meter', *args, orientation=None, bar_color=(None, None),
button_color=None, size=DEFAULT_PROGRESS_BAR_SIZE, border_width=None, grab_anywhere=False): button_color=None, size=DEFAULT_PROGRESS_BAR_SIZE, border_width=None, grab_anywhere=False):
global _one_line_progress_meters global _one_line_progress_meters
@ -5596,7 +5596,7 @@ def OneLineProgressMeter(title, current_value, max_value, key, *args, orientatio
return rc # return whatever the update told us return rc # return whatever the update told us
def OneLineProgressMeterCancel(key): def OneLineProgressMeterCancel(key='OK for 1 meter'):
global _one_line_progress_meters global _one_line_progress_meters
try: try:

View File

@ -1,5 +1,5 @@
#!/usr/bin/python3 #!/usr/bin/python3
version = __version__ = "0.17.1.2 Unreleased\n VSeparator added (spelling error), Radio.reset_group added and removed the clearing all when one cleared" version = __version__ = "0.17.1.3 Unreleased\n VSeparator added (spelling error), Radio.reset_group added and removed the clearing all when one cleared, added default key for one_line_progress_meter"
port = 'PySimpleGUIWx' port = 'PySimpleGUIWx'
@ -5639,7 +5639,7 @@ class QuickMeter(object):
return self.stat_messages return self.stat_messages
def OneLineProgressMeter(title, current_value, max_value, key, *args, orientation='v', bar_color=(None, None), def OneLineProgressMeter(title, current_value, max_value, key='OK for 1 meter', *args, orientation='v', bar_color=(None, None),
button_color=None, size=DEFAULT_PROGRESS_BAR_SIZE, border_width=None, grab_anywhere=False): button_color=None, size=DEFAULT_PROGRESS_BAR_SIZE, border_width=None, grab_anywhere=False):
if key not in QuickMeter.active_meters: if key not in QuickMeter.active_meters:
meter = QuickMeter(title, current_value, max_value, key, *args, orientation=orientation, bar_color=bar_color, meter = QuickMeter(title, current_value, max_value, key, *args, orientation=orientation, bar_color=bar_color,
@ -5652,7 +5652,7 @@ def OneLineProgressMeter(title, current_value, max_value, key, *args, orientatio
OneLineProgressMeter.exit_reasons = getattr(OneLineProgressMeter,'exit_reasons', QuickMeter.exit_reasons) OneLineProgressMeter.exit_reasons = getattr(OneLineProgressMeter,'exit_reasons', QuickMeter.exit_reasons)
return rc == METER_OK return rc == METER_OK
def OneLineProgressMeterCancel(key): def OneLineProgressMeterCancel(key='OK for 1 meter'):
try: try:
meter = QuickMeter.active_meters[key] meter = QuickMeter.active_meters[key]
meter.window.Close() meter.window.Close()