mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 23:42:23 -04:00
remove self explanatory module docstrings; strip trailing whitespace
This commit is contained in:
parent
9f55c831c0
commit
9421a037f6
25 changed files with 45 additions and 193 deletions
|
@ -28,7 +28,7 @@ Edit the card:
|
||||||
|
|
||||||
fields = card.fact.model.fieldModels
|
fields = card.fact.model.fieldModels
|
||||||
for field in fields:
|
for field in fields:
|
||||||
card.fact[field.name] = "newvalue"
|
card.fact[field.name] = 'newvalue'
|
||||||
card.fact.setModified(textChanged=True, deck=deck)
|
card.fact.setModified(textChanged=True, deck=deck)
|
||||||
deck.setModified()
|
deck.setModified()
|
||||||
|
|
||||||
|
@ -46,7 +46,6 @@ Save & close:
|
||||||
deck.save()
|
deck.save()
|
||||||
deck.close()
|
deck.close()
|
||||||
"""
|
"""
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
__import__('pkg_resources').declare_namespace(__name__)
|
__import__('pkg_resources').declare_namespace(__name__)
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Cards
|
|
||||||
====================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import time, sys, math, random
|
import time, sys, math, random
|
||||||
from anki.db import *
|
from anki.db import *
|
||||||
from anki.models import CardModel, Model, FieldModel, formatQA
|
from anki.models import CardModel, Model, FieldModel, formatQA
|
||||||
|
|
|
@ -13,7 +13,6 @@ object_session() is a replacement for the standard object_session(), which
|
||||||
provides the features of SessionHelper, and avoids taking out another
|
provides the features of SessionHelper, and avoids taking out another
|
||||||
transaction.
|
transaction.
|
||||||
"""
|
"""
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from pysqlite2 import dbapi2 as sqlite
|
from pysqlite2 import dbapi2 as sqlite
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
The Deck
|
|
||||||
====================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import tempfile, time, os, random, sys, re, stat, shutil
|
import tempfile, time, os, random, sys, re, stat, shutil
|
||||||
import types, traceback, simplejson, datetime
|
import types, traceback, simplejson, datetime
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Errors
|
|
||||||
==============================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
class Error(Exception):
|
class Error(Exception):
|
||||||
def __init__(self, message="", **data):
|
def __init__(self, message="", **data):
|
||||||
self.data = data
|
self.data = data
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Exporting support
|
|
||||||
==============================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import itertools, time, re, os, HTMLParser
|
import itertools, time, re, os, HTMLParser
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
from anki import DeckStorage
|
from anki import DeckStorage
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Facts
|
|
||||||
========
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
from anki.db import *
|
from anki.db import *
|
||||||
from anki.errors import *
|
from anki.errors import *
|
||||||
|
|
|
@ -2,11 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Fonts - mapping to/from platform-specific fonts
|
|
||||||
==============================================================
|
|
||||||
"""
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
# set this to 'all', to get all fonts in a list
|
# set this to 'all', to get all fonts in a list
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Graphs of deck statistics
|
|
||||||
==============================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import os, sys, time
|
import os, sys, time
|
||||||
import anki.stats
|
import anki.stats
|
||||||
from anki.lang import _
|
from anki.lang import _
|
||||||
|
|
|
@ -2,17 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
History - keeping a record of all reviews
|
|
||||||
==========================================
|
|
||||||
|
|
||||||
If users run 'check db', duplicate records will be inserted into the DB - I
|
|
||||||
really should have used the time stamp as the key. You can remove them by
|
|
||||||
keeping the lowest id for any given timestamp.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
from anki.db import *
|
from anki.db import *
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,6 @@ may be extended by calling code if a file has more fields. To ignore a
|
||||||
particular FieldModel, replace it with None. A special number 0 donates a tags
|
particular FieldModel, replace it with None. A special number 0 donates a tags
|
||||||
field. The same field model should not occur more than once."""
|
field. The same field model should not occur more than once."""
|
||||||
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
from anki.cards import cardsTable
|
from anki.cards import cardsTable
|
||||||
from anki.facts import factsTable, fieldsTable
|
from anki.facts import factsTable, fieldsTable
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Importing Anki 0.9+ decks
|
|
||||||
==========================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
from anki import DeckStorage
|
from anki import DeckStorage
|
||||||
from anki.importing import Importer
|
from anki.importing import Importer
|
||||||
from anki.sync import SyncClient, SyncServer, copyLocalMedia
|
from anki.sync import SyncClient, SyncServer, copyLocalMedia
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Importing CSV/TSV files
|
|
||||||
========================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import codecs, csv, re
|
import codecs, csv, re
|
||||||
from anki.importing import Importer, ForeignCard
|
from anki.importing import Importer, ForeignCard
|
||||||
from anki.lang import _
|
from anki.lang import _
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Importing Mnemosyne 1.0 decks
|
|
||||||
==============================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import sys, pickle, time, re
|
import sys, pickle, time, re
|
||||||
from anki.importing import Importer, ForeignCard
|
from anki.importing import Importer, ForeignCard
|
||||||
from anki.errors import *
|
from anki.errors import *
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Copyright: petr.michalec@gmail.com
|
# Copyright: petr.michalec@gmail.com
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Importing Supermemo XML decks
|
|
||||||
==============================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from anki.importing import Importer, ForeignCard
|
from anki.importing import Importer, ForeignCard
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Author Chris Aakre <caaakre@gmail.com>
|
# Author Chris Aakre <caaakre@gmail.com>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Importing WCU files
|
|
||||||
====================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
from anki.importing import Importer, ForeignCard
|
from anki.importing import Importer, ForeignCard
|
||||||
from anki.lang import _
|
from anki.lang import _
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Internationalisation
|
|
||||||
=====================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import os, sys
|
import os, sys
|
||||||
import gettext
|
import gettext
|
||||||
import threading
|
import threading
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Latex support
|
|
||||||
==============================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import re, tempfile, os, sys, shutil, cgi, subprocess
|
import re, tempfile, os, sys, shutil, cgi, subprocess
|
||||||
from anki.utils import genID, checksum, call
|
from anki.utils import genID, checksum, call
|
||||||
from anki.hooks import addHook
|
from anki.hooks import addHook
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Media support
|
|
||||||
====================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import os, shutil, re, urllib2, time, tempfile, unicodedata, urllib
|
import os, shutil, re, urllib2, time, tempfile, unicodedata, urllib
|
||||||
from anki.db import *
|
from anki.db import *
|
||||||
from anki.utils import checksum, genID
|
from anki.utils import checksum, genID
|
||||||
|
|
|
@ -2,16 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Model - define the way in which facts are added and shown
|
|
||||||
==========================================================
|
|
||||||
|
|
||||||
- Field models
|
|
||||||
- Card models
|
|
||||||
- Models
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
import time, re
|
import time, re
|
||||||
from sqlalchemy.ext.orderinglist import ordering_list
|
from sqlalchemy.ext.orderinglist import ordering_list
|
||||||
from anki.db import *
|
from anki.db import *
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Sound support
|
|
||||||
==============================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import re, sys, threading, time, subprocess, os, signal, errno, atexit
|
import re, sys, threading, time, subprocess, os, signal, errno, atexit
|
||||||
import tempfile, shutil
|
import tempfile, shutil
|
||||||
from anki.hooks import addHook, runHook
|
from anki.hooks import addHook, runHook
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Statistical tracking and reports
|
|
||||||
=================================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
# we track statistics over the life of the deck, and per-day
|
# we track statistics over the life of the deck, and per-day
|
||||||
STATS_LIFE = 0
|
STATS_LIFE = 0
|
||||||
STATS_DAY = 1
|
STATS_DAY = 1
|
||||||
|
|
|
@ -2,15 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Synchronisation
|
|
||||||
==============================
|
|
||||||
|
|
||||||
Support for keeping two decks synchronized. Both local syncing and syncing
|
|
||||||
over HTTP are supported.
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import zlib, re, urllib, urllib2, socket, simplejson, time, shutil
|
import zlib, re, urllib, urllib2, socket, simplejson, time, shutil
|
||||||
import os, base64, httplib, sys, tempfile, httplib, types
|
import os, base64, httplib, sys, tempfile, httplib, types
|
||||||
from datetime import date
|
from datetime import date
|
||||||
|
|
|
@ -2,13 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Tags
|
|
||||||
====================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
|
|
||||||
from anki.db import *
|
from anki.db import *
|
||||||
|
|
||||||
#src 0 = fact
|
#src 0 = fact
|
||||||
|
|
|
@ -2,12 +2,6 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
"""\
|
|
||||||
Miscellaneous utilities
|
|
||||||
==============================
|
|
||||||
"""
|
|
||||||
__docformat__ = 'restructuredtext'
|
|
||||||
|
|
||||||
import re, os, random, time, types, math, htmlentitydefs, subprocess
|
import re, os, random, time, types, math, htmlentitydefs, subprocess
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue