Last active
September 15, 2019 16:56
-
-
Save kelciour/a5f7325ef1e310873279ee092a08a900 to your computer and use it in GitHub Desktop.
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
fields = ['Вопрос', 'Видео', 'Аудио', 'Картинка', 'Ответ', 'Похожие слова', 'Транскрипция', 'Пример', 'Синонимы', 'Видео интернет', 'Доп слова из карточки', 'Root', 'MW синонимы'] | |
name = 'video1Syn (ru-board)' | |
model = mw.col.models.byName("video1Syn") | |
notes = mw.col.models.nids(model) | |
print("Found {} notes".format(len(notes))) | |
m = mw.col.models.copy(model) | |
m['name'] = name | |
m['did'] = mw.col.decks.id(name) | |
mw.col.models.setCurrent(m) | |
for t in m['tmpls'][1:]: | |
mw.col.models.remTemplate(m, t) | |
for i in mw.col.models.fieldNames(m)[13:]: | |
f = m['flds'][13] | |
mw.col.models.remField(m, f) | |
for nid in notes: | |
n = mw.col.getNote(nid) | |
for i in ["", " 2", " 3", " 4", " 5"]: | |
note = mw.col.newNote() | |
for fld in fields: | |
note[fld] = n[fld + i] | |
ncards = mw.col.addNote(note) | |
mw.reset() | |
print('Done!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment