From d8669835d859abbf26cc95fe61a90dd349c6b279 Mon Sep 17 00:00:00 2001 From: Arthur Milchior Date: Sat, 8 Feb 2020 22:37:50 -0800 Subject: [PATCH] aqt.exporter takes extra argument cid --- pylib/anki/exporting.py | 2 +- qt/aqt/exporting.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pylib/anki/exporting.py b/pylib/anki/exporting.py index 84196f5c5..6be5bf0a0 100644 --- a/pylib/anki/exporting.py +++ b/pylib/anki/exporting.py @@ -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 diff --git a/qt/aqt/exporting.py b/qt/aqt/exporting.py index 964685927..a97eb7ce3 100644 --- a/qt/aqt/exporting.py +++ b/qt/aqt/exporting.py @@ -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