diff --git a/anki/__init__.py b/anki/__init__.py index d617bd801..90a90beac 100644 --- a/anki/__init__.py +++ b/anki/__init__.py @@ -4,8 +4,8 @@ import sys -if sys.version_info[0] < 3 or sys.version_info[1] < 6: - raise Exception("Anki requires Python 3.6+") +if sys.version_info[0] < 3 or sys.version_info[1] < 5: + raise Exception("Anki requires Python 3.5+") if sys.getfilesystemencoding().lower() in ("ascii", "ansi_x3.4-1968"): raise Exception("Anki requires a UTF-8 locale.") diff --git a/aqt/addons.py b/aqt/addons.py index d0c2f3684..a98524fef 100644 --- a/aqt/addons.py +++ b/aqt/addons.py @@ -330,7 +330,7 @@ class AddonsDialog(QDialog): if not addon: return if re.match(r"^\d+$", addon): - openLink(aqt.appShared + f"info/{addon}") + openLink(aqt.appShared + "info/{}".format(addon)) else: showWarning(_("Add-on was not downloaded from AnkiWeb.")) diff --git a/aqt/browser.py b/aqt/browser.py index 6fe2dcc6d..09a05d07c 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -1383,7 +1383,7 @@ where id in %s""" % ids2str(sf)) self._updatePreviewButtons() self._previewWeb.eval( - f"{func}({json.dumps(txt)},'{bodyclass}');") + "{}({},'{}');".format(func, json.dumps(txt), bodyclass)) def _onPreviewShowBothSides(self, toggle): self._previewBothSides = toggle diff --git a/aqt/errors.py b/aqt/errors.py index 182084a24..bccfdb90b 100644 --- a/aqt/errors.py +++ b/aqt/errors.py @@ -145,8 +145,9 @@ add-ons section of our support site. else: platname = "Linux" - return f"""\ -Anki {appVersion} Python {platform.python_version()} Qt {QT_VERSION_STR} PyQt {PYQT_VERSION_STR} -Platform: {platname} -Flags: frz={getattr(sys, "frozen", False)} ao={self.mw.addonManager.dirty} -""" + return """\ +Anki {} Python {} Qt {} PyQt {} +Platform: {} +Flags: frz={} ao={} +""".format(appVersion, platform.python_version(), QT_VERSION_STR, PYQT_VERSION_STR, platname, + getattr(sys, "frozen", False), self.mw.addonManager.dirty) diff --git a/aqt/main.py b/aqt/main.py index 9c652e90a..56fe1ab42 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -288,7 +288,7 @@ close the profile or restart Anki.""")) if getattr(w, "silentlyClose", None): w.close() else: - showWarning(f"Window should have been closed: {w}") + showWarning("Window should have been closed: {}".format(w)) def unloadProfileAndExit(self): self.unloadProfile(self.cleanupAndExit) diff --git a/aqt/reviewer.py b/aqt/reviewer.py index 2f216c532..5f1b2706b 100644 --- a/aqt/reviewer.py +++ b/aqt/reviewer.py @@ -119,12 +119,12 @@ class Reviewer: def revHtml(self): extra = self.mw.col.conf.get("reviewExtra", "") - return f""" + return """
-{extra} -""" +{} +""".format(extra) def _initWeb(self): self._reps = 0 diff --git a/aqt/utils.py b/aqt/utils.py index 2fdf8954d..aa4c0a121 100644 --- a/aqt/utils.py +++ b/aqt/utils.py @@ -503,7 +503,7 @@ class MenuList: end = items[-1].title prefix = os.path.commonprefix([start.upper(), end.upper()]) n = len(prefix)+1 - return f"{start[:n].upper()}-{end[:n].upper()}" + return "{}-{}".format(start[:n].upper(), end[:n].upper()) class SubMenu(MenuList): def __init__(self, title): diff --git a/aqt/webview.py b/aqt/webview.py index b6275d772..815628e75 100644 --- a/aqt/webview.py +++ b/aqt/webview.py @@ -217,21 +217,21 @@ border-radius:5px; font-family: Helvetica }""" from aqt import mw head = mw.baseHTML() + head + csstxt + jstxt - html=f""" + html = """ -{self.title} +{} -{head} +{} -{body} -""" +{} +""".format(self.title, self.zoomFactor(), fontspec, buttonspec, head, body) #print(html) self.setHtml(html)