mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-02 19:14:32 +12:00
40 lines
908 B
Python
40 lines
908 B
Python
|
#!/usr/bin/env python
|
||
|
# --!-- coding: utf8 --!--
|
||
|
import os
|
||
|
import shutil
|
||
|
import subprocess
|
||
|
|
||
|
from PyQt5.QtCore import QSettings
|
||
|
from PyQt5.QtWidgets import QWidget
|
||
|
|
||
|
|
||
|
class abstractImporter:
|
||
|
"""
|
||
|
abstractImporter is used to import documents into manuskript.
|
||
|
|
||
|
The startImport function must be subclassed. It takes a filePath (str to
|
||
|
the document to import), and must return `outlineItem`s.
|
||
|
"""
|
||
|
|
||
|
name = ""
|
||
|
description = ""
|
||
|
fileFormat = "" # File format accepted. For example: "OPML Files (*.opml)"
|
||
|
# For folder, use "<<folder>>"
|
||
|
icon = ""
|
||
|
|
||
|
@classmethod
|
||
|
def startImport(cls, filePath):
|
||
|
"""
|
||
|
Takes a str path to the file/folder to import, and return `outlineItem`s.
|
||
|
"""
|
||
|
pass
|
||
|
|
||
|
@classmethod
|
||
|
def settingsWidget(cls):
|
||
|
"""
|
||
|
Returns a QWidget if needed for settings.
|
||
|
"""
|
||
|
return None
|
||
|
|
||
|
|