Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #58561
| From | SH <sshhhhhh@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Anki add-on - Help needed |
| Date | 2013-11-06 14:17 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <l5dj1j$8gr$6@dont-email.me> (permalink) |
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
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
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
csiph-web