-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add deck and note options. #12
Open
holocronweaver
wants to merge
15
commits into
kerrickstaley:main
Choose a base branch
from
holocronweaver:options
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
28766a3
Add deck options via new OptionsGroup class.
holocronweaver eab7246
Add per-note options and a deck creation time.
holocronweaver 685d962
Ensure deck creation time is an integer.
holocronweaver ebacc3c
Fix a few typos and a minor interface inconsistency.
holocronweaver cd261da
Rename note.level -> stage to reduce ambiguity.
holocronweaver 6eb44fa
Minor coding style improvement.
holocronweaver 96606ec
Document deck and note options.
holocronweaver 0fa1870
Internally document note and deck options further.
holocronweaver a5a8d00
Fix a couple field name typos in apgk_col.
holocronweaver 4d0449a
Update tests to create OptionGroups.
holocronweaver 61b18b5
Add Card.status to allow suspending and burying cards.
holocronweaver bda7097
Move note options to CardOptions and try to match database field names.
holocronweaver 8286fbc
Merge 'upstream/master' into options.
holocronweaver 0a13191
Remove CardOptions and set options directly on Card or via Note.
holocronweaver d9fd190
Avoid relative commits in __init__.py
holocronweaver File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add Card.status to allow suspending and burying cards.
- Loading branch information
commit 61b18b5ad043c2b4c0894ef147fad825b7ae4334
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be called
type
. In general, we should always use the same variable naming that Anki does. If Anki's naming is confusing (which it often is), detailed comments will help make the field's purpose clear to the user.Ditto for all the other properties here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean just within this function, or in the user-facing API as well?
If the latter, I think of this as 'spreading the disease', where one unintuitive interface gives rise to another, but I can understand wanting a close correspondence for debugging. I doubt many users will be familiar with the Anki DB column names, so I don't believe it will make the lib easier to learn. So...I'll make the change, but I'll feel dirty, lol.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I remember now why I didn't use
type
for a variable name: it's a Python reserved keyword. Perhaps we should make an exception in this case?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to closely match Anki's naming. I want
genanki
to be a lower-level library that more-or-less directly maps to the way Anki represents data. Plus, the user will probably have to end up learning the Anki names anyway, for example if they're digging into thecollections.anki2
SQLite file to debug something. Abstractions are leaky more often than people expect.I's OK to use
type
as the name. If you need to access the realtype()
function, you can import thebuiltins
module and callbuiltins.type
. (Previously I also had an instance of this, calling a paramord_
instead oford
. But I changed it because it's silly to convolute your external API for the convenience of internal code, and I wasn't usingord()
anyway).