Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-PyMsgBox for openSUSE:Factory
checked in at 2022-08-30 14:50:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-PyMsgBox (Old)
and /work/SRC/openSUSE:Factory/.python-PyMsgBox.new.2083 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-PyMsgBox"
Tue Aug 30 14:50:33 2022 rev:5 rq:1000172 version:1.0.9
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-PyMsgBox/python-PyMsgBox.changes
2019-09-25 08:40:38.470285572 +0200
+++
/work/SRC/openSUSE:Factory/.python-PyMsgBox.new.2083/python-PyMsgBox.changes
2022-08-30 14:51:20.536405533 +0200
@@ -1,0 +2,8 @@
+Sun Aug 28 22:33:36 UTC 2022 - Yogalakshmi Arunachalam <[email protected]>
+
+- Update to 1.0.9
+ * no upstream changelog
+- Update to 1.0.8
+ * Text is automatically converted to string with str()
+
+-------------------------------------------------------------------
Old:
----
PyMsgBox-1.0.7.tar.gz
New:
----
PyMsgBox-1.0.9.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-PyMsgBox.spec ++++++
--- /var/tmp/diff_new_pack.obAwee/_old 2022-08-30 14:51:20.940406563 +0200
+++ /var/tmp/diff_new_pack.obAwee/_new 2022-08-30 14:51:20.948406584 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-PyMsgBox
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-PyMsgBox
-Version: 1.0.7
+Version: 1.0.9
Release: 0
Summary: A Python module for JavaScript-like message boxes
License: BSD-3-Clause
++++++ PyMsgBox-1.0.7.tar.gz -> PyMsgBox-1.0.9.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyMsgBox-1.0.7/PKG-INFO new/PyMsgBox-1.0.9/PKG-INFO
--- old/PyMsgBox-1.0.7/PKG-INFO 2019-06-18 20:19:48.834768500 +0200
+++ new/PyMsgBox-1.0.9/PKG-INFO 2020-10-11 03:51:28.239751000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: PyMsgBox
-Version: 1.0.7
+Version: 1.0.9
Summary: A simple, cross-platform, pure Python module for JavaScript-like
message boxes.
Home-page: https://github.com/asweigart/pymsgbox
Author: Al Sweigart
@@ -48,4 +48,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
Description-Content-Type: text/markdown
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyMsgBox-1.0.7/setup.py new/PyMsgBox-1.0.9/setup.py
--- old/PyMsgBox-1.0.7/setup.py 2019-06-18 05:43:15.000000000 +0200
+++ new/PyMsgBox-1.0.9/setup.py 2020-10-11 03:50:33.000000000 +0200
@@ -33,6 +33,7 @@
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
- 'Programming Language :: Python :: 3.8'
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
],
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyMsgBox-1.0.7/src/PyMsgBox.egg-info/PKG-INFO
new/PyMsgBox-1.0.9/src/PyMsgBox.egg-info/PKG-INFO
--- old/PyMsgBox-1.0.7/src/PyMsgBox.egg-info/PKG-INFO 2019-06-18
20:19:48.000000000 +0200
+++ new/PyMsgBox-1.0.9/src/PyMsgBox.egg-info/PKG-INFO 2020-10-11
03:51:27.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: PyMsgBox
-Version: 1.0.7
+Version: 1.0.9
Summary: A simple, cross-platform, pure Python module for JavaScript-like
message boxes.
Home-page: https://github.com/asweigart/pymsgbox
Author: Al Sweigart
@@ -48,4 +48,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
Description-Content-Type: text/markdown
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyMsgBox-1.0.7/src/PyMsgBox.egg-info/SOURCES.txt
new/PyMsgBox-1.0.9/src/PyMsgBox.egg-info/SOURCES.txt
--- old/PyMsgBox-1.0.7/src/PyMsgBox.egg-info/SOURCES.txt 2019-06-18
20:19:48.000000000 +0200
+++ new/PyMsgBox-1.0.9/src/PyMsgBox.egg-info/SOURCES.txt 2020-10-11
03:51:27.000000000 +0200
@@ -1,6 +1,7 @@
MANIFEST.in
README.md
code_of_conduct.md
+pyproject.toml
setup.py
docs/Makefile
docs/basics.rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyMsgBox-1.0.7/src/pymsgbox/__init__.py
new/PyMsgBox-1.0.9/src/pymsgbox/__init__.py
--- old/PyMsgBox-1.0.7/src/pymsgbox/__init__.py 2019-06-18 07:14:38.000000000
+0200
+++ new/PyMsgBox-1.0.9/src/pymsgbox/__init__.py 2020-10-11 03:50:42.000000000
+0200
@@ -1,7 +1,7 @@
# PyMsgBox - A simple, cross-platform, pure Python module for JavaScript-like
message boxes.
# By Al Sweigart [email protected]
-__version__ = '1.0.7'
+__version__ = "1.0.9"
# Modified BSD License
# Derived from Stephen Raymond Ferg's EasyGui http://easygui.sourceforge.net/
@@ -36,6 +36,7 @@
"""
import sys
+
RUNNING_PYTHON_2 = sys.version_info[0] == 2
# Because PyAutoGUI requires PyMsgBox but might be installed on systems
@@ -50,38 +51,43 @@
else:
import tkinter as tk
- rootWindowPosition = '+300+200'
+ rootWindowPosition = "+300+200"
- if tk.TkVersion < 8.0 :
- raise RuntimeError('You are running Tk version: ' + str(tk.TkVersion)
+ 'You must be using Tk version 8.0 or greater to use PyMsgBox.')
+ if tk.TkVersion < 8.0:
+ raise RuntimeError(
+ "You are running Tk version: "
+ + str(tk.TkVersion)
+ + "You must be using Tk version 8.0 or greater to use PyMsgBox."
+ )
except ImportError:
TKINTER_IMPORT_SUCCEEDED = False
+PROPORTIONAL_FONT_FAMILY = ("MS", "Sans", "Serif")
+MONOSPACE_FONT_FAMILY = "Courier"
-PROPORTIONAL_FONT_FAMILY = ('MS', 'Sans', 'Serif')
-MONOSPACE_FONT_FAMILY = ('Courier')
-
-PROPORTIONAL_FONT_SIZE = 10
-MONOSPACE_FONT_SIZE = 9 #a little smaller, because it it more legible at
a smaller size
-TEXT_ENTRY_FONT_SIZE = 12 # a little larger makes it easier to see
+PROPORTIONAL_FONT_SIZE = 10
+MONOSPACE_FONT_SIZE = (
+ 9
+) # a little smaller, because it it more legible at a smaller size
+TEXT_ENTRY_FONT_SIZE = 12 # a little larger makes it easier to see
-STANDARD_SELECTION_EVENTS = ['Return', 'Button-1', 'space']
+STANDARD_SELECTION_EVENTS = ["Return", "Button-1", "space"]
# constants for strings: (TODO: for internationalization, change these)
-OK_TEXT = 'OK'
-CANCEL_TEXT = 'Cancel'
-YES_TEXT = 'Yes'
-NO_TEXT = 'No'
-RETRY_TEXT = 'Retry'
-ABORT_TEXT = 'Abort'
-IGNORE_TEXT = 'Ignore'
-TRY_AGAIN_TEXT = 'Try Again'
-CONTINUE_TEXT = 'Continue'
+OK_TEXT = "OK"
+CANCEL_TEXT = "Cancel"
+YES_TEXT = "Yes"
+NO_TEXT = "No"
+RETRY_TEXT = "Retry"
+ABORT_TEXT = "Abort"
+IGNORE_TEXT = "Ignore"
+TRY_AGAIN_TEXT = "Try Again"
+CONTINUE_TEXT = "Continue"
-TIMEOUT_RETURN_VALUE = 'Timeout'
+TIMEOUT_RETURN_VALUE = "Timeout"
# Initialize some global variables that will be reset later
__choiceboxMultipleSelect = None
@@ -90,8 +96,8 @@
__choiceboxResults = None
__firstWidget = None
__enterboxText = None
-__enterboxDefaultText=''
-__multenterboxText = ''
+__enterboxDefaultText = ""
+__multenterboxText = ""
choiceboxChoices = None
choiceboxWidget = None
entryWidget = None
@@ -99,50 +105,72 @@
buttonsFrame = None
-
-
-
-def _alertTkinter(text='', title='', button=OK_TEXT, root=None, timeout=None):
+def _alertTkinter(text="", title="", button=OK_TEXT, root=None, timeout=None):
"""Displays a simple message box with text and a single OK button. Returns
the text of the button clicked on."""
- assert TKINTER_IMPORT_SUCCEEDED, 'Tkinter is required for pymsgbox'
- retVal = _buttonbox(msg=text, title=title, choices=[str(button)],
root=root, timeout=timeout)
+ assert TKINTER_IMPORT_SUCCEEDED, "Tkinter is required for pymsgbox"
+ text = str(text)
+ retVal = _buttonbox(
+ msg=text, title=title, choices=[str(button)], root=root,
timeout=timeout
+ )
if retVal is None:
return button
else:
return retVal
+
+
alert = _alertTkinter
-def _confirmTkinter(text='', title='', buttons=(OK_TEXT, CANCEL_TEXT),
root=None, timeout=None):
+def _confirmTkinter(
+ text="", title="", buttons=(OK_TEXT, CANCEL_TEXT), root=None, timeout=None
+):
"""Displays a message box with OK and Cancel buttons. Number and text of
buttons can be customized. Returns the text of the button clicked on."""
- assert TKINTER_IMPORT_SUCCEEDED, 'Tkinter is required for pymsgbox'
- return _buttonbox(msg=text, title=title, choices=[str(b) for b in
buttons], root=root, timeout=timeout)
+ assert TKINTER_IMPORT_SUCCEEDED, "Tkinter is required for pymsgbox"
+ text = str(text)
+ return _buttonbox(
+ msg=text,
+ title=title,
+ choices=[str(b) for b in buttons],
+ root=root,
+ timeout=timeout,
+ )
+
+
confirm = _confirmTkinter
-def _promptTkinter(text='', title='' , default='', root=None, timeout=None):
+def _promptTkinter(text="", title="", default="", root=None, timeout=None):
"""Displays a message box with text input, and OK & Cancel buttons.
Returns the text entered, or None if Cancel was clicked."""
- assert TKINTER_IMPORT_SUCCEEDED, 'Tkinter is required for pymsgbox'
- return __fillablebox(text, title, default=default, mask=None,root=root,
timeout=timeout)
+ assert TKINTER_IMPORT_SUCCEEDED, "Tkinter is required for pymsgbox"
+ text = str(text)
+ return __fillablebox(
+ text, title, default=default, mask=None, root=root, timeout=timeout
+ )
+
+
prompt = _promptTkinter
-def _passwordTkinter(text='', title='', default='', mask='*', root=None,
timeout=None):
+def _passwordTkinter(text="", title="", default="", mask="*", root=None,
timeout=None):
"""Displays a message box with text input, and OK & Cancel buttons. Typed
characters appear as *. Returns the text entered, or None if Cancel was
clicked."""
- assert TKINTER_IMPORT_SUCCEEDED, 'Tkinter is required for pymsgbox'
+ assert TKINTER_IMPORT_SUCCEEDED, "Tkinter is required for pymsgbox"
+ text = str(text)
return __fillablebox(text, title, default, mask=mask, root=root,
timeout=timeout)
+
+
password = _passwordTkinter
# Load the native versions of the alert/confirm/prompt/password functions, if
available:
-if sys.platform == 'win32':
+if sys.platform == "win32":
from . import _native_win
- NO_ICON = 0
- STOP = 0x10
+
+ NO_ICON = 0
+ STOP = 0x10
QUESTION = 0x20
- WARNING = 0x30
- INFO = 0x40
- alert = _native_win.alert
+ WARNING = 0x30
+ INFO = 0x40
+ alert = _native_win.alert
confirm = _native_win.confirm
@@ -165,7 +193,6 @@
"""
global boxRoot, __replyButtonText, __widgetTexts, buttonsFrame
-
# Initialize __replyButtonText to the first choice.
# This is what will be used if the window is closed by the close button.
__replyButtonText = choices[0]
@@ -179,7 +206,7 @@
boxRoot.withdraw()
boxRoot.title(title)
- boxRoot.iconname('Dialog')
+ boxRoot.iconname("Dialog")
boxRoot.geometry(rootWindowPosition)
boxRoot.minsize(400, 100)
@@ -194,7 +221,7 @@
# -------------------- place the widgets in the frames
-----------------------
messageWidget = tk.Message(messageFrame, text=msg, width=400)
messageWidget.configure(font=(PROPORTIONAL_FONT_FAMILY,
PROPORTIONAL_FONT_SIZE))
- messageWidget.pack(side=tk.TOP, expand=tk.YES, fill=tk.X, padx='3m',
pady='3m')
+ messageWidget.pack(side=tk.TOP, expand=tk.YES, fill=tk.X, padx="3m",
pady="3m")
__put_buttons_in_buttonframe(choices)
@@ -212,7 +239,8 @@
if __replyButtonText != TIMEOUT_RETURN_VALUE:
__replyButtonText = None
- if root: root.deiconify()
+ if root:
+ root.deiconify()
return __replyButtonText
@@ -228,7 +256,9 @@
for buttonText in choices:
tempButton = tk.Button(buttonsFrame, takefocus=1, text=buttonText)
_bindArrows(tempButton)
- tempButton.pack(expand=tk.YES, side=tk.LEFT, padx='1m', pady='1m',
ipadx='2m', ipady='1m')
+ tempButton.pack(
+ expand=tk.YES, side=tk.LEFT, padx="1m", pady="1m", ipadx="2m",
ipady="1m"
+ )
# remember the text associated with this widget
__widgetTexts[tempButton] = buttonText
@@ -239,46 +269,49 @@
i = 1
# for the commandButton, bind activation events to the activation
event handler
- commandButton = tempButton
+ commandButton = tempButton
handler = __buttonEvent
for selectionEvent in STANDARD_SELECTION_EVENTS:
- commandButton.bind('<%s>' % selectionEvent, handler)
+ commandButton.bind("<%s>" % selectionEvent, handler)
if CANCEL_TEXT in choices:
- commandButton.bind('<Escape>', __cancelButtonEvent)
+ commandButton.bind("<Escape>", __cancelButtonEvent)
def _bindArrows(widget, skipArrowKeys=False):
- widget.bind('<Down>', _tabRight)
- widget.bind('<Up>' , _tabLeft)
+ widget.bind("<Down>", _tabRight)
+ widget.bind("<Up>", _tabLeft)
if not skipArrowKeys:
- widget.bind('<Right>',_tabRight)
- widget.bind('<Left>' , _tabLeft)
+ widget.bind("<Right>", _tabRight)
+ widget.bind("<Left>", _tabLeft)
+
def _tabRight(event):
- boxRoot.event_generate('<Tab>')
+ boxRoot.event_generate("<Tab>")
+
def _tabLeft(event):
- boxRoot.event_generate('<Shift-Tab>')
+ boxRoot.event_generate("<Shift-Tab>")
def __buttonEvent(event):
"""
Handle an event that is generated by a person clicking a button.
"""
- global boxRoot, __widgetTexts, __replyButtonText
+ global boxRoot, __widgetTexts, __replyButtonText
__replyButtonText = __widgetTexts[event.widget]
- boxRoot.quit() # quit the main loop
+ boxRoot.quit() # quit the main loop
+
def __cancelButtonEvent(event):
"""Handle pressing Esc by clicking the Cancel button."""
- global boxRoot, __widgetTexts, __replyButtonText
+ global boxRoot, __widgetTexts, __replyButtonText
__replyButtonText = CANCEL_TEXT
boxRoot.quit()
-def __fillablebox(msg, title='', default='', mask=None, root=None,
timeout=None):
+def __fillablebox(msg, title="", default="", mask=None, root=None,
timeout=None):
"""
Show a box in which a user can enter some text.
You may optionally specify some default text, which will appear in the
@@ -290,11 +323,11 @@
global cancelButton, entryWidget, okButton
if title == None:
- title == ''
+ title == ""
if default == None:
- default = ''
+ default = ""
__enterboxDefaultText = default
- __enterboxText = __enterboxDefaultText
+ __enterboxText = __enterboxDefaultText
if root:
root.withdraw()
@@ -305,9 +338,9 @@
boxRoot.withdraw()
boxRoot.title(title)
- boxRoot.iconname('Dialog')
+ boxRoot.iconname("Dialog")
boxRoot.geometry(rootWindowPosition)
- boxRoot.bind('<Escape>', __enterboxCancel)
+ boxRoot.bind("<Escape>", __enterboxCancel)
# ------------- define the messageFrame ---------------------------------
messageFrame = tk.Frame(master=boxRoot)
@@ -317,7 +350,6 @@
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)
@@ -326,10 +358,10 @@
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)
+ # -------------------- the msg widget ----------------------------
+ messageWidget = tk.Message(messageFrame, width="4.5i", text=msg)
messageWidget.configure(font=(PROPORTIONAL_FONT_FAMILY,
PROPORTIONAL_FONT_SIZE))
- messageWidget.pack(side=tk.RIGHT, expand=1, fill=tk.BOTH, padx='3m',
pady='3m')
+ messageWidget.pack(side=tk.RIGHT, expand=1, fill=tk.BOTH, padx="3m",
pady="3m")
# --------- entryWidget ----------------------------------------------
entryWidget = tk.Entry(entryFrame, width=40)
@@ -337,47 +369,49 @@
entryWidget.configure(font=(PROPORTIONAL_FONT_FAMILY,
TEXT_ENTRY_FONT_SIZE))
if mask:
entryWidget.configure(show=mask)
- entryWidget.pack(side=tk.LEFT, padx='3m')
- entryWidget.bind('<Return>', __enterboxGetText)
- entryWidget.bind('<Escape>', __enterboxCancel)
+ entryWidget.pack(side=tk.LEFT, padx="3m")
+ entryWidget.bind("<Return>", __enterboxGetText)
+ entryWidget.bind("<Escape>", __enterboxCancel)
# put text into the entryWidget and have it pre-highlighted
- if __enterboxDefaultText != '':
- entryWidget.insert(0,__enterboxDefaultText)
+ if __enterboxDefaultText != "":
+ entryWidget.insert(0, __enterboxDefaultText)
entryWidget.select_range(0, tk.END)
# ------------------ ok button -------------------------------
okButton = tk.Button(buttonsFrame, takefocus=1, text=OK_TEXT)
_bindArrows(okButton)
- okButton.pack(expand=1, side=tk.LEFT, padx='3m', pady='3m', ipadx='2m',
ipady='1m')
+ 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
+ commandButton = okButton
handler = __enterboxGetText
for selectionEvent in STANDARD_SELECTION_EVENTS:
- commandButton.bind('<%s>' % selectionEvent, handler)
-
+ commandButton.bind("<%s>" % selectionEvent, handler)
# ------------------ cancel button -------------------------------
cancelButton = tk.Button(buttonsFrame, takefocus=1, text=CANCEL_TEXT)
_bindArrows(cancelButton)
- cancelButton.pack(expand=1, side=tk.RIGHT, padx='3m', pady='3m',
ipadx='2m', ipady='1m')
+ 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
+ commandButton = cancelButton
handler = __enterboxCancel
for selectionEvent in STANDARD_SELECTION_EVENTS:
- commandButton.bind('<%s>' % selectionEvent, handler)
+ commandButton.bind("<%s>" % selectionEvent, handler)
# ------------------- time for action! -----------------
- entryWidget.focus_force() # put the focus on the entryWidget
+ entryWidget.focus_force() # put the focus on the entryWidget
boxRoot.deiconify()
if timeout is not None:
boxRoot.after(timeout, timeoutBoxRoot)
boxRoot.mainloop() # run it!
# -------- after the run has completed ----------------------------------
- if root: root.deiconify()
+ if root:
+ root.deiconify()
try:
boxRoot.destroy() # button_click didn't destroy boxRoot, so we do it
now
except tk.TclError:
@@ -397,7 +431,7 @@
def __enterboxRestore(event):
global entryWidget
- entryWidget.delete(0,len(entryWidget.get()))
+ entryWidget.delete(0, len(entryWidget.get()))
entryWidget.insert(0, __enterboxDefaultText)
@@ -406,6 +440,3 @@
__enterboxText = None
boxRoot.quit()
-
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyMsgBox-1.0.7/src/pymsgbox/_native_win.py
new/PyMsgBox-1.0.9/src/pymsgbox/_native_win.py
--- old/PyMsgBox-1.0.7/src/pymsgbox/_native_win.py 2019-06-18
07:40:01.000000000 +0200
+++ new/PyMsgBox-1.0.9/src/pymsgbox/_native_win.py 2020-05-12
02:01:33.000000000 +0200
@@ -46,12 +46,21 @@
runningOnPython2 = sys.version_info[0] == 2
if runningOnPython2:
messageBoxFunc = ctypes.windll.user32.MessageBoxA
-else: # Python 3 functions.
+else: # Python 3 functions.
messageBoxFunc = ctypes.windll.user32.MessageBoxW
-def alert(text='', title='', button=pymsgbox.OK_TEXT, root=None, timeout=None,
icon=NO_ICON, _tkinter=False):
+def alert(
+ text="",
+ title="",
+ button=pymsgbox.OK_TEXT,
+ root=None,
+ timeout=None,
+ icon=NO_ICON,
+ _tkinter=False,
+):
"""Displays a simple message box with text and a single OK button. Returns
the text of the button clicked on."""
+ text = str(text)
if (_tkinter) or (timeout is not None) or (button != pymsgbox.OK_TEXT):
# Timeouts are not supported by Windows message boxes.
# Call the original tkinter alert function, not this native one:
@@ -60,8 +69,18 @@
messageBoxFunc(0, text, title, MB_OK | MB_SETFOREGROUND | MB_TOPMOST |
icon)
return button
-def confirm(text='', title='', buttons=(pymsgbox.OK_TEXT,
pymsgbox.CANCEL_TEXT), root=None, timeout=None, icon=QUESTION, _tkinter=False):
+
+def confirm(
+ text="",
+ title="",
+ buttons=(pymsgbox.OK_TEXT, pymsgbox.CANCEL_TEXT),
+ root=None,
+ timeout=None,
+ icon=QUESTION,
+ _tkinter=False,
+):
"""Displays a message box with OK and Cancel buttons. Number and text of
buttons can be customized. Returns the text of the button clicked on."""
+ text = str(text)
buttonFlag = None
if len(buttons) == 1:
if buttons[0] == pymsgbox.OK_TEXT:
@@ -74,18 +93,32 @@
elif buttons[0] == pymsgbox.RETRY_TEXT and buttons[1] ==
pymsgbox.CANCEL_TEXT:
buttonFlag = MB_RETRYCANCEL
elif len(buttons) == 3:
- if buttons[0] == pymsgbox.ABORT_TEXT and buttons[1] ==
pymsgbox.RETRY_TEXT and buttons[2] == pymsgbox.IGNORE_TEXT:
+ if (
+ buttons[0] == pymsgbox.ABORT_TEXT
+ and buttons[1] == pymsgbox.RETRY_TEXT
+ and buttons[2] == pymsgbox.IGNORE_TEXT
+ ):
buttonFlag = MB_ABORTRETRYIGNORE
- elif buttons[0] == pymsgbox.CANCEL_TEXT and buttons[1] ==
pymsgbox.TRY_AGAIN_TEXT and buttons[2] == pymsgbox.CONTINUE_TEXT:
+ elif (
+ buttons[0] == pymsgbox.CANCEL_TEXT
+ and buttons[1] == pymsgbox.TRY_AGAIN_TEXT
+ and buttons[2] == pymsgbox.CONTINUE_TEXT
+ ):
buttonFlag = MB_CANCELTRYCONTINUE
- elif buttons[0] == pymsgbox.YES_TEXT and buttons[1] ==
pymsgbox.NO_TEXT and buttons[2] == pymsgbox.CANCEL_TEXT:
+ elif (
+ buttons[0] == pymsgbox.YES_TEXT
+ and buttons[1] == pymsgbox.NO_TEXT
+ and buttons[2] == pymsgbox.CANCEL_TEXT
+ ):
buttonFlag = MB_YESNOCANCEL
if (_tkinter) or (timeout is not None) or (buttonFlag is None):
# Call the original tkinter confirm() function, not this native one:
return pymsgbox._confirmTkinter(text, title, buttons, root, timeout)
- retVal = messageBoxFunc(0, text, title, buttonFlag | MB_SETFOREGROUND |
MB_TOPMOST | icon)
+ retVal = messageBoxFunc(
+ 0, text, title, buttonFlag | MB_SETFOREGROUND | MB_TOPMOST | icon
+ )
if retVal == IDOK or len(buttons) == 1:
return pymsgbox.OK_TEXT
elif retVal == IDCANCEL:
@@ -105,8 +138,7 @@
elif retVal == IDABORT:
return pymsgbox.ABORT_TEXT
else:
- assert False, 'Unexpected return value from MessageBox: %s' % (retVal)
-
+ assert False, "Unexpected return value from MessageBox: %s" % (retVal)
'''
@@ -118,4 +150,4 @@
"""Displays a message box with text input, and OK & Cancel buttons. Typed
characters appear as *. Returns the text entered, or None if Cancel was
clicked."""
pass
-'''
\ No newline at end of file
+'''
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/PyMsgBox-1.0.7/tests/test_pymsgbox.py
new/PyMsgBox-1.0.9/tests/test_pymsgbox.py
--- old/PyMsgBox-1.0.7/tests/test_pymsgbox.py 2019-06-18 07:46:28.000000000
+0200
+++ new/PyMsgBox-1.0.9/tests/test_pymsgbox.py 2020-10-11 03:49:27.000000000
+0200
@@ -5,7 +5,6 @@
import threading
import inspect
-sys.path.insert(0, os.path.abspath('..'))
import pymsgbox
# Note: Yes, PyAutoGUI does have PyMsgBox itself as a dependency, but we won't
be using that part of PyAutoGUI for this testing.
@@ -13,7 +12,7 @@
pyautogui.PAUSE = 0.1
-GUI_WAIT = 0.2 # if tests start failing, maybe try bumping this up a bit
(though that'll slow the tests down)
+GUI_WAIT = 0.4 # if tests start failing, maybe try bumping this up a bit
(though that'll slow the tests down)
"""