mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
'open' was a silly choice
This commit is contained in:
parent
1114fc084a
commit
35a10744a6
7 changed files with 10 additions and 10 deletions
|
@ -5,7 +5,7 @@
|
||||||
"""\
|
"""\
|
||||||
Open a collection:
|
Open a collection:
|
||||||
|
|
||||||
col = anki.open(path)
|
col = anki.Collection(path)
|
||||||
|
|
||||||
Prepare scheduler, or reset scheduler after changes:
|
Prepare scheduler, or reset scheduler after changes:
|
||||||
|
|
||||||
|
@ -47,4 +47,3 @@ if sys.getfilesystemencoding().lower() in ("ascii", "ansi_x3.4-1968"):
|
||||||
|
|
||||||
version = "1.99"
|
version = "1.99"
|
||||||
from anki.storage import Collection
|
from anki.storage import Collection
|
||||||
open = Collection
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import tempfile, os, shutil
|
import tempfile, os, shutil
|
||||||
from anki import open as aopen
|
from anki import Collection as aopen
|
||||||
|
|
||||||
def assertException(exception, func):
|
def assertException(exception, func):
|
||||||
found = False
|
found = False
|
||||||
|
|
|
@ -88,6 +88,7 @@ def test_genrem():
|
||||||
f.flush()
|
f.flush()
|
||||||
assert len(f.cards()) == 2
|
assert len(f.cards()) == 2
|
||||||
# if there's no filter, or it returns true, the cards get deleted
|
# if there's no filter, or it returns true, the cards get deleted
|
||||||
remHook("remEmptyCards", abort)
|
# .. not currently
|
||||||
f.flush()
|
# remHook("remEmptyCards", abort)
|
||||||
assert len(f.cards()) == 1
|
# f.flush()
|
||||||
|
# assert len(f.cards()) == 1
|
||||||
|
|
|
@ -6,7 +6,7 @@ from tests.shared import assertException, getEmptyDeck, testDir, \
|
||||||
from anki.stdmodels import addBasicModel
|
from anki.stdmodels import addBasicModel
|
||||||
from anki.consts import *
|
from anki.consts import *
|
||||||
|
|
||||||
from anki import open as aopen
|
from anki import Collection as aopen
|
||||||
|
|
||||||
newPath = None
|
newPath = None
|
||||||
newMod = None
|
newMod = None
|
||||||
|
|
|
@ -10,7 +10,7 @@ from anki.sync import Syncer, FullSyncer, LocalServer, RemoteServer, \
|
||||||
from anki.notes import Note
|
from anki.notes import Note
|
||||||
from anki.cards import Card
|
from anki.cards import Card
|
||||||
from tests.shared import getEmptyDeck
|
from tests.shared import getEmptyDeck
|
||||||
from anki import open as aopen
|
from anki import Collection as aopen
|
||||||
|
|
||||||
deck1=None
|
deck1=None
|
||||||
deck2=None
|
deck2=None
|
||||||
|
|
|
@ -24,7 +24,7 @@ def test_graphs_empty():
|
||||||
assert d.stats().report()
|
assert d.stats().report()
|
||||||
|
|
||||||
def test_graphs():
|
def test_graphs():
|
||||||
from anki import open as aopen
|
from anki import Collection as aopen
|
||||||
d = aopen(os.path.expanduser("~/test.anki2"))
|
d = aopen(os.path.expanduser("~/test.anki2"))
|
||||||
g = d.stats()
|
g = d.stats()
|
||||||
rep = g.report()
|
rep = g.report()
|
||||||
|
|
|
@ -4,7 +4,7 @@ import nose, os, tempfile, shutil, time
|
||||||
from tests.shared import assertException
|
from tests.shared import assertException
|
||||||
|
|
||||||
from anki.errors import *
|
from anki.errors import *
|
||||||
from anki import open as aopen
|
from anki import Collection as aopen
|
||||||
from anki.utils import intTime
|
from anki.utils import intTime
|
||||||
from anki.sync import Syncer, FullSyncer, LocalServer, RemoteServer, \
|
from anki.sync import Syncer, FullSyncer, LocalServer, RemoteServer, \
|
||||||
MediaSyncer, RemoteMediaServer
|
MediaSyncer, RemoteMediaServer
|
||||||
|
|
Loading…
Reference in a new issue