aqt.exporter takes extra argument cid

This commit is contained in:
Arthur Milchior 2020-02-08 22:37:50 -08:00
parent af26922493
commit d8669835d8
2 changed files with 5 additions and 3 deletions

View File

@ -8,7 +8,7 @@ import shutil
import unicodedata
import zipfile
from io import BufferedWriter
from typing import Any, Dict, List, Tuple, Union
from typing import Any, Dict, List, Optional, Tuple, Union
from zipfile import ZipFile
from anki import hooks

View File

@ -4,6 +4,7 @@
import os
import re
import time
from typing import List, Optional
import aqt
from anki import hooks
@ -14,17 +15,18 @@ from aqt.utils import checkInvalidFilename, getSaveFile, showInfo, showWarning,
class ExportDialog(QDialog):
def __init__(self, mw, did=None):
def __init__(self, mw, did: Optional[int] = None, cids: Optional[List[int]] = None):
QDialog.__init__(self, mw, Qt.Window)
self.mw = mw
self.col = mw.col
self.frm = aqt.forms.exporting.Ui_ExportDialog()
self.frm.setupUi(self)
self.exporter = None
self.cids = cids
self.setup(did)
self.exec_()
def setup(self, did):
def setup(self, did: Optional[int]):
self.exporters = exporters()
# if a deck specified, start with .apkg type selected
idx = 0