def __init__(self, col): Exporter.__init__(self, col) # Support for custom user CSS data_path = os.path.join(addon_path, "user_data") user_css_file = os.path.join(data_path, "user.css") try: with open(user_css_file, "r") as f: self.user_style = f.read() except (IOError, OSError): try: with open(user_css_file, "w+") as f: # write default style f.write(self.user_style) except (IOError, OSError): pass if isWin: # xhtml2pdf needs the media collection base path for images # to work. Weirdly enough, supplying the path on Linux # causes images to stop rendering. Not sure if macOS # behaves the same. self.media_path = mw.col.media.dir().encode(sys_encoding) else: self.media_path = None
def __init__(self, col): Exporter.__init__(self, col) self.file = None self.tagFilterArray = []
def __init__(self, col) -> None: Exporter.__init__(self, col) self.count = -1 # number of items exported, to report back to the UI