Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #58561 > unrolled thread

Anki add-on - Help needed

Started bySH <sshhhhhh@invalid.invalid>
First post2013-11-06 14:17 +0000
Last post2013-11-06 10:02 -0500
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  Anki add-on - Help needed SH <sshhhhhh@invalid.invalid> - 2013-11-06 14:17 +0000
    Re: Anki add-on - Help needed Joel Goldstick <joel.goldstick@gmail.com> - 2013-11-06 10:02 -0500

#58561 — Anki add-on - Help needed

FromSH <sshhhhhh@invalid.invalid>
Date2013-11-06 14:17 +0000
SubjectAnki add-on - Help needed
Message-ID<l5dj1j$8gr$6@dont-email.me>
Is anybody here able to help me finish off an Anki add-on? If you're not
familiar with it, Anki (http://ankisrs.net/) is an open source, cross
platform flashcard learning program, in PyQT. It's extensible, with add-
ons.

Thing is, I'm not a programmer, but I've managed to make my own add-on by
trying to figure out how other people's add-ons work. I've got something
that works, but it needs finishing off.

There is a lot I don't understand, but I've got this snippet which will
retrieve a value associated with the key 'dictKey' from a dictionary held
in a file. However, it will only do it if I open the Options dialog in
Anki (I'm guessing that's what DeckConf.loadConf is about). How can I get
that value for use in another function, without having to open the dialog?

[code]
from aqt.deckconf import DeckConf
from anki.hooks import wrap

def load_dictVal(self):
    c = self.conf
    x = c.get('dictKey')
    print(x)

DeckConf.loadConf = wrap(DeckConf.loadConf, load_dictVal)
[/code]

The dictionary is in a file at (on Linux) ~/Anki/User 1/collection.anki2.
'User 1' may vary, and each user has their own collection.anki2 file. The
file's header says it's 'SQLite format 3'.


Secondly, separate from the above, I want to get a True/False value from
whether a deck is currently being studied? Maybe whether the review screen
is open, or something?

Any help would be greatly appreciated.

-- 

Stew

[toc] | [next] | [standalone]


#58564

FromJoel Goldstick <joel.goldstick@gmail.com>
Date2013-11-06 10:02 -0500
Message-ID<mailman.2081.1383750127.18130.python-list@python.org>
In reply to#58561
On Wed, Nov 6, 2013 at 9:17 AM, SH <sshhhhhh@invalid.invalid> wrote:
> Is anybody here able to help me finish off an Anki add-on? If you're not
> familiar with it, Anki (http://ankisrs.net/) is an open source, cross
> platform flashcard learning program, in PyQT. It's extensible, with add-
> ons.
>
> Thing is, I'm not a programmer, but I've managed to make my own add-on by
> trying to figure out how other people's add-ons work. I've got something
> that works, but it needs finishing off.
>
> There is a lot I don't understand, but I've got this snippet which will
> retrieve a value associated with the key 'dictKey' from a dictionary held
> in a file. However, it will only do it if I open the Options dialog in
> Anki (I'm guessing that's what DeckConf.loadConf is about). How can I get
> that value for use in another function, without having to open the dialog?
>
> [code]
> from aqt.deckconf import DeckConf
> from anki.hooks import wrap
>
> def load_dictVal(self):
>     c = self.conf
>     x = c.get('dictKey')
>     print(x)
>
> DeckConf.loadConf = wrap(DeckConf.loadConf, load_dictVal)
> [/code]
>
> The dictionary is in a file at (on Linux) ~/Anki/User 1/collection.anki2.
> 'User 1' may vary, and each user has their own collection.anki2 file. The
> file's header says it's 'SQLite format 3'.
>
>
> Secondly, separate from the above, I want to get a True/False value from
> whether a deck is currently being studied? Maybe whether the review screen
> is open, or something?
>
> Any help would be greatly appreciated.
>
> --
>
> Stew
>
> --
> https://mail.python.org/mailman/listinfo/python-list

Best to you if someone here can help, but your question isn't really a
python question as much as one about how anki or pyqt work.  Have you
looked for mailing lists for pyqt or anki? you might have better luck
there.

-- 
Joel Goldstick
http://joelgoldstick.com

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web