Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] anki: fix type errors and profile saving.
@ 2021-11-08 15:45 dm1tz
  2021-11-13 19:44 ` paper42
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: dm1tz @ 2021-11-08 15:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1650 bytes --]

There is a new 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?
- [ ] 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: 4413 bytes --]

From 86d469aea8782052f1b682e92636a9cb763bcf53 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.
---
 srcpkgs/anki/patches/disable_popup.patch    | 10 +++++
 srcpkgs/anki/patches/fix_float.patch        | 42 +++++++++++++++++++++
 srcpkgs/anki/patches/fix_profile_save.patch | 14 +++++++
 srcpkgs/anki/template                       |  2 +-
 4 files changed, 67 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

diff --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..5aed8126f27e
--- /dev/null
+++ b/srcpkgs/anki/patches/fix_profile_save.patch
@@ -0,0 +1,14 @@
+--- 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: anki: fix type errors and profile saving.
  2021-11-08 15:45 [PR PATCH] anki: fix type errors and profile saving dm1tz
@ 2021-11-13 19:44 ` paper42
  2021-11-13 20:58 ` dm1tz
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paper42 @ 2021-11-13 19:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/33964#issuecomment-968126077

Comment:
Good job, did you create these patches or got them from somewhere? 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: anki: fix type errors and profile saving.
  2021-11-08 15:45 [PR PATCH] anki: fix type errors and profile saving dm1tz
  2021-11-13 19:44 ` paper42
@ 2021-11-13 20:58 ` dm1tz
  2021-11-13 22:06 ` paper42
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dm1tz @ 2021-11-13 20:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 290 bytes --]

New comment by dm1tz on void-packages repository

https://github.com/void-linux/void-packages/pull/33964#issuecomment-968135082

Comment:
> Good job, did you create these patches or got them from somewhere?

Thanks, I borrowed one that disables update dialog from AUR, the rest are mine.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: anki: fix type errors and profile saving.
  2021-11-08 15:45 [PR PATCH] anki: fix type errors and profile saving 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
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paper42 @ 2021-11-13 22:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 290 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/33964#issuecomment-968155005

Comment:
Could you describe why is the fix_profile_save patch necessary? How can I reproduce a crash/bug? This would be also nice to mention in the patch.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: anki: fix type errors and profile saving.
  2021-11-08 15:45 [PR PATCH] anki: fix type errors and profile saving dm1tz
                   ` (2 preceding siblings ...)
  2021-11-13 22:06 ` paper42
@ 2021-11-13 23:32 ` dm1tz
  2021-11-16 23:22 ` [PR PATCH] [Updated] " dm1tz
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dm1tz @ 2021-11-13 23:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 543 bytes --]

New comment by dm1tz on void-packages repository

https://github.com/void-linux/void-packages/pull/33964#issuecomment-968174857

Comment:
> Could you describe why is the fix_profile_save patch necessary?

It fixes the ```<class 'SystemError'>: PY_SSIZE_T_CLEAN macro must be defined for '#' formats``` error when anki is trying to save your profile data on exit. 

> How can I reproduce a crash/bug?

Create a profile or login into the ankiweb account and then exit anki. 
> This would be also nice to mention in the patch.

Will do.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Updated] anki: fix type errors and profile saving.
  2021-11-08 15:45 [PR PATCH] anki: fix type errors and profile saving dm1tz
                   ` (3 preceding siblings ...)
  2021-11-13 23:32 ` dm1tz
@ 2021-11-16 23:22 ` dm1tz
  2021-11-17 13:03 ` dm1tz
  2021-11-17 16:23 ` [PR PATCH] [Merged]: " paper42
  6 siblings, 0 replies; 8+ messages in thread
From: dm1tz @ 2021-11-16 23:22 UTC (permalink / raw)
  To: ml

[-- 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.
---
 srcpkgs/anki/patches/disable_popup.patch    | 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

diff --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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Updated] anki: fix type errors and profile saving.
  2021-11-08 15:45 [PR PATCH] anki: fix type errors and profile saving dm1tz
                   ` (4 preceding siblings ...)
  2021-11-16 23:22 ` [PR PATCH] [Updated] " dm1tz
@ 2021-11-17 13:03 ` dm1tz
  2021-11-17 16:23 ` [PR PATCH] [Merged]: " paper42
  6 siblings, 0 replies; 8+ messages in thread
From: dm1tz @ 2021-11-17 13:03 UTC (permalink / raw)
  To: ml

[-- 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.
---
 srcpkgs/anki/patches/disable_popup.patch    | 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

diff --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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Merged]: anki: fix type errors and profile saving.
  2021-11-08 15:45 [PR PATCH] anki: fix type errors and profile saving dm1tz
                   ` (5 preceding siblings ...)
  2021-11-17 13:03 ` dm1tz
@ 2021-11-17 16:23 ` paper42
  6 siblings, 0 replies; 8+ messages in thread
From: paper42 @ 2021-11-17 16:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1506 bytes --]

There's a merged pull request on the void-packages repository

anki: fix type errors and profile saving.
https://github.com/void-linux/void-packages/pull/33964

Description:
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
-->


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-11-17 16:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 15:45 [PR PATCH] anki: fix type errors and profile saving 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
2021-11-17 16:23 ` [PR PATCH] [Merged]: " paper42

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).