mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
* Update authors to "jrnl contributors" to comply with GPL3 * Include jrnl email address with contributors * Include GPL notice in jrnl --version * Apply consistent copyright and license to all Python files * Add copyright and license to documentation * Add copyright and license to docs theme * Wiping poetry cache to try to resolve a test issue * Testing with Python 3.9.0 in attempt to bypass GitHub Actions failure in 3.9.1 * make format * Exclude Windows Python 3.9 build which is failing due to a GitHub Actions problem * Modify testing to get around this 3.9 issue... * Fix exclude
45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
#!/usr/bin/env python
|
|
# encoding: utf-8
|
|
# Copyright (C) 2012-2021 jrnl contributors
|
|
# License: https://www.gnu.org/licenses/gpl-3.0.html
|
|
|
|
from .fancy_exporter import FancyExporter
|
|
from .jrnl_importer import JRNLImporter
|
|
from .json_exporter import JSONExporter
|
|
from .markdown_exporter import MarkdownExporter
|
|
from .tag_exporter import TagExporter
|
|
from .template_exporter import __all__ as template_exporters
|
|
from .text_exporter import TextExporter
|
|
from .xml_exporter import XMLExporter
|
|
from .yaml_exporter import YAMLExporter
|
|
|
|
__exporters = [
|
|
JSONExporter,
|
|
MarkdownExporter,
|
|
TagExporter,
|
|
TextExporter,
|
|
XMLExporter,
|
|
YAMLExporter,
|
|
FancyExporter,
|
|
] + template_exporters
|
|
__importers = [JRNLImporter]
|
|
|
|
__exporter_types = {name: plugin for plugin in __exporters for name in plugin.names}
|
|
__importer_types = {name: plugin for plugin in __importers for name in plugin.names}
|
|
|
|
EXPORT_FORMATS = sorted(__exporter_types.keys())
|
|
IMPORT_FORMATS = sorted(__importer_types.keys())
|
|
|
|
|
|
def get_exporter(format):
|
|
for exporter in __exporters:
|
|
if hasattr(exporter, "names") and format in exporter.names:
|
|
return exporter
|
|
return None
|
|
|
|
|
|
def get_importer(format):
|
|
for importer in __importers:
|
|
if hasattr(importer, "names") and format in importer.names:
|
|
return importer
|
|
return None
|