Skip to content
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

Replacing integral constant by constant name #269

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions anki/cards.py
Expand Up @@ -34,8 +34,8 @@ def __init__(self, col, id=None):
self.id = timestampID(col.db, "cards")
self.did = 1
self.crt = intTime()
self.type = 0
self.queue = 0
self.type = CARD_NEW
self.queue = QUEUE_NEW_CRAM
self.ivl = 0
self.factor = 0
self.reps = 0
Expand Down Expand Up @@ -73,7 +73,7 @@ def flush(self):
self.mod = intTime()
self.usn = self.col.usn()
# bug check
if self.queue == 2 and self.odue and not self.col.decks.isDyn(self.did):
if self.queue == QUEUE_REV and self.odue and not self.col.decks.isDyn(self.did):
runHook("odueInvalid")
assert self.due < 4294967296
self.col.db.execute(
Expand Down Expand Up @@ -104,7 +104,7 @@ def flushSched(self):
self.mod = intTime()
self.usn = self.col.usn()
# bug checks
if self.queue == 2 and self.odue and not self.col.decks.isDyn(self.did):
if self.queue == QUEUE_REV and self.odue and not self.col.decks.isDyn(self.did):
runHook("odueInvalid")
assert self.due < 4294967296
self.col.db.execute(
Expand Down
28 changes: 28 additions & 0 deletions anki/consts.py
Expand Up @@ -54,6 +54,34 @@

HELP_SITE="http://ankisrs.net/docs/manual.html"

# Queue types
QUEUE_SCHED_BURIED = -3
QUEUE_USER_BURIED = -2
QUEUE_SUSPENDED = -1
QUEUE_NEW_CRAM = 0
QUEUE_LRN = 1
QUEUE_REV = 2
QUEUE_DAY_LRN = 3
QUEUE_PREVIEW = 4

# Revlog types
REVLOG_LRN = 0
REVLOG_REV = 1
REVLOG_RELRN = 2
REVLOG_CRAM = 3

# Card types
CARD_NEW = 0
CARD_LRN = 1
CARD_DUE = 2
CARD_FILTERED = 3

# Buttons
BUTTON_ONE = 1
BUTTON_TWO = 2
BUTTON_THREE = 3
BUTTON_FOUR = 4

# Labels
##########################################################################

Expand Down