diff --git a/winpython/controlpanel.py b/winpython/controlpanel.py index 6d815336..5b7d0e95 100644 --- a/winpython/controlpanel.py +++ b/winpython/controlpanel.py @@ -687,7 +687,7 @@ def setup_window(self): # Help menu about_action = create_action( self, - "About %s..." % self.NAME, + f"About {self.NAME}...", icon=get_std_icon('MessageBoxInformation'), triggered=self.about, ) @@ -706,7 +706,7 @@ def setup_window(self): status = self.statusBar() status.setObjectName("StatusBar") status.showMessage( - "Welcome to %s!" % self.NAME, 5000 + f"Welcome to {self.NAME}!", 5000 ) # Button layouts @@ -823,8 +823,7 @@ def distribution_changed(self, path): self.untable.refresh_distribution(dist) self.distribution = dist self.selector.label.setText( - 'Python %s %dbit:' - % (dist.version, dist.architecture) + f'Python {dist.version} {dist.architecture}bit:' ) def add_packages(self): @@ -887,8 +886,7 @@ def process_packages(self, action): for index, package in enumerate(packages): progress.setValue(index) progress.setLabelText( - "%s %s %s..." - % (text, package.name, package.version) + f"{text} {package.name} {package.version}..." ) QApplication.processEvents() if progress.wasCanceled(): @@ -915,9 +913,9 @@ def process_packages(self, action): QMessageBox.critical( self, "Error", - "Unable to %s %s" - "

Error message:
%s" - % (action, pstr, error), + f"Unable to {action} {" + f"

Error message:
{error}" + , ) progress.setValue(progress.maximum()) status.clearMessage() @@ -930,12 +928,12 @@ def process_packages(self, action): def report_issue(self): - issue_template = """\ -Python distribution: %s -Control panel version: %s + issue_template = f"""\ +Python distribution: {python_distribution_infos()} +Control panel version: {__version__} -Python Version: %s -Qt Version: %s, %s %s +Python Version: {platform.python_version()} +Qt Version: {winpython._vendor.qtpy.QtCore.__version__}, {winpython.qt.API_NAME} {winpython._vendor.qtpy.__version__} What steps will reproduce the problem? 1. @@ -946,16 +944,9 @@ def report_issue(self): Please provide any additional information below. -""" % ( - python_distribution_infos(), - __version__, - platform.python_version(), - winpython._vendor.qtpy.QtCore.__version__, - winpython.qt.API_NAME, - winpython._vendor.qtpy.__version__, - ) +""" - url = QUrl("%s/issues/entry" % __project_url__) + url = QUrl(f"{__project_url__}/issues/entry") url.addQueryItem("comment", issue_template) QDesktopServices.openUrl(url) @@ -963,27 +954,18 @@ def about(self): """About this program""" QMessageBox.about( self, - "About %s" % self.NAME, - """%s %s + f"About {self.NAME}", + f"""{self.NAME} {__version__}
Package Manager and Advanced Tasks

Copyright © 2012 Pierre Raybaut
Licensed under the terms of the MIT License

Created, developed and maintained by Pierre Raybaut -

WinPython at Github.io: downloads, bug reports, +

WinPython at Github.io: downloads, bug reports, discussions, etc.

This program is executed by:
- %s
- Python %s, Qt %s, %s qtpy %s""" - % ( - self.NAME, - __version__, - __project_url__, - python_distribution_infos(), - platform.python_version(), - winpython._vendor.qtpy.QtCore.__version__, - winpython._vendor.qtpy.API_NAME, - winpython._vendor.qtpy.__version__, - ), + {python_distribution_infos()}
+ Python {platform.python_version()}, Qt {winpython._vendor.qtpy.QtCore.__version__}, {winpython._vendor.qtpy.API_NAME} qtpy {winpython._vendor.qtpy.__version__}""" + , )