From: dm1tz <dm1tz@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] anki: fix type errors and profile saving.
Date: Wed, 17 Nov 2021 14:03:48 +0100 [thread overview]
Message-ID: <20211117130348.Li4luXAecoj3EVt9S8fh6AXSrD7E2QyttzbGlcHGkcM@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-33964@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 1655 bytes --]
There is an updated pull request by dm1tz against master on the void-packages repository
https://github.com/dm1tz/void-packages anki
https://github.com/void-linux/void-packages/pull/33964
anki: fix type errors and profile saving.
Also, disable useless auto update dialog on start.
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/33964.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-anki-33964.patch --]
[-- Type: text/x-diff, Size: 4467 bytes --]
From 7e4d62245e66ff60072d5c80e5614d7e4b6f24d9 Mon Sep 17 00:00:00 2001
From: Dmitry Zakharchenko <dmitz@disroot.org>
Date: Mon, 8 Nov 2021 17:38:21 +0200
Subject: [PATCH] anki: fix type errors and profile saving.
Also, disable useless auto update dialog on start.
---
| 10 +++++
srcpkgs/anki/patches/fix_float.patch | 42 +++++++++++++++++++++
srcpkgs/anki/patches/fix_profile_save.patch | 15 ++++++++
srcpkgs/anki/template | 2 +-
4 files changed, 68 insertions(+), 1 deletion(-)
create mode 100644 srcpkgs/anki/patches/disable_popup.patch
create mode 100644 srcpkgs/anki/patches/fix_float.patch
create mode 100644 srcpkgs/anki/patches/fix_profile_save.patch
--git a/srcpkgs/anki/patches/disable_popup.patch b/srcpkgs/anki/patches/disable_popup.patch
new file mode 100644
index 000000000000..8b7a041fc656
--- /dev/null
+++ b/srcpkgs/anki/patches/disable_popup.patch
@@ -0,0 +1,10 @@
+--- a/aqt/update.py
++++ b/aqt/update.py
+@@ -31,6 +31,7 @@ class LatestVersionFinder(QThread):
+ return d
+
+ def run(self):
++ return
+ if not self.config['updates']:
+ return
+ d = self._data()
diff --git a/srcpkgs/anki/patches/fix_float.patch b/srcpkgs/anki/patches/fix_float.patch
new file mode 100644
index 000000000000..333d76c8efd7
--- /dev/null
+++ b/srcpkgs/anki/patches/fix_float.patch
@@ -0,0 +1,42 @@
+--- a/aqt/deckconf.py
++++ b/aqt/deckconf.py
+@@ -172,7 +172,7 @@ class DeckConf(QDialog):
+ f.lrnGradInt.setValue(c['ints'][0])
+ f.lrnEasyInt.setValue(c['ints'][1])
+ f.lrnEasyInt.setValue(c['ints'][1])
+- f.lrnFactor.setValue(c['initialFactor']/10.0)
++ f.lrnFactor.setValue(c['initialFactor']//10)
+ f.newOrder.setCurrentIndex(c['order'])
+ f.newPerDay.setValue(c['perDay'])
+ f.bury.setChecked(c.get("bury", True))
+@@ -180,7 +180,7 @@ class DeckConf(QDialog):
+ # rev
+ c = self.conf['rev']
+ f.revPerDay.setValue(c['perDay'])
+- f.easyBonus.setValue(c['ease4']*100)
++ f.easyBonus.setValue(int(c['ease4'])*100)
+ f.fi1.setValue(c['ivlFct']*100)
+ f.maxIvl.setValue(c['maxIvl'])
+ f.revplim.setText(self.parentLimText('rev'))
+@@ -192,7 +192,7 @@ class DeckConf(QDialog):
+ # lapse
+ c = self.conf['lapse']
+ f.lapSteps.setText(self.listToUser(c['delays']))
+- f.lapMult.setValue(c['mult']*100)
++ f.lapMult.setValue(int(c['mult'])*100)
+ f.lapMinInt.setValue(c['minInt'])
+ f.leechThreshold.setValue(c['leechFails'])
+ f.leechAction.setCurrentIndex(c['leechAction'])
+--- a/aqt/preferences.py
++++ b/aqt/preferences.py
+@@ -77,8 +77,8 @@ class Preferences(QDialog):
+ f.hwAccel.setVisible(False)
+ else:
+ f.hwAccel.setChecked(self.mw.pm.glMode() != "software")
+- f.lrnCutoff.setValue(qc['collapseTime']/60.0)
+- f.timeLimit.setValue(qc['timeLim']/60.0)
++ f.lrnCutoff.setValue(qc['collapseTime']//60)
++ f.timeLimit.setValue(qc['timeLim']//60)
+ f.showEstimates.setChecked(qc['estTimes'])
+ f.showProgress.setChecked(qc['dueCounts'])
+ f.nightMode.setChecked(qc.get("nightMode", False))
diff --git a/srcpkgs/anki/patches/fix_profile_save.patch b/srcpkgs/anki/patches/fix_profile_save.patch
new file mode 100644
index 000000000000..9d72a1a20e82
--- /dev/null
+++ b/srcpkgs/anki/patches/fix_profile_save.patch
@@ -0,0 +1,15 @@
+Fixes crash related to saving profile data on exit.
+--- a/aqt/profiles.py
++++ b/aqt/profiles.py
+@@ -160,7 +160,10 @@ a flash drive.""" % self.base)
+ return up.load()
+
+ def _pickle(self, obj):
+- return pickle.dumps(obj, protocol=0)
++ for key, val in obj.items():
++ if isinstance(val, QByteArray):
++ obj[key] = bytes(val) # type: ignore
++ return pickle.dumps(obj, protocol=4)
+
+ def load(self, name):
+ assert name != "_global"
diff --git a/srcpkgs/anki/template b/srcpkgs/anki/template
index f2a476844717..3cb3155760ea 100644
--- a/srcpkgs/anki/template
+++ b/srcpkgs/anki/template
@@ -1,7 +1,7 @@
# Template file for 'anki'
pkgname=anki
version=2.1.15
-revision=5
+revision=6
build_style=gnu-makefile
depends="python3-PyQt5-webengine python3-requests python3-SQLAlchemy
python3-PyAudio python3-mpv python3-Markdown python3-send2trash
next prev parent reply other threads:[~2021-11-17 13:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-08 15:45 [PR PATCH] " dm1tz
2021-11-13 19:44 ` paper42
2021-11-13 20:58 ` dm1tz
2021-11-13 22:06 ` paper42
2021-11-13 23:32 ` dm1tz
2021-11-16 23:22 ` [PR PATCH] [Updated] " dm1tz
2021-11-17 13:03 ` dm1tz [this message]
2021-11-17 16:23 ` [PR PATCH] [Merged]: " paper42
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211117130348.Li4luXAecoj3EVt9S8fh6AXSrD7E2QyttzbGlcHGkcM@z \
--to=dm1tz@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).