From aa6e0a7c848fa7166b3c743890ef0e989550cb5f Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Fri, 7 May 2021 20:44:07 -0600 Subject: [PATCH] Remove 'importer' or 'exporter' from filenames where not needed --- docs/extending-jrnl.md | 6 +++--- jrnl/plugins/exporter/{dates_exporter.py => dates.py} | 0 jrnl/plugins/exporter/{fancy_exporter.py => fancy.py} | 0 jrnl/plugins/exporter/{json_exporter.py => json.py} | 0 jrnl/plugins/exporter/{markdown_exporter.py => markdown.py} | 0 jrnl/plugins/exporter/{tag_exporter.py => tag.py} | 5 +++-- jrnl/plugins/exporter/{testing_exporter.py => testing.py} | 0 jrnl/plugins/exporter/{text_exporter.py => text.py} | 0 jrnl/plugins/exporter/{xml_exporter.py => xml.py} | 2 -- jrnl/plugins/exporter/{yaml_exporter.py => yaml.py} | 0 jrnl/plugins/importer/{jrnl_importer.py => jrnl.py} | 0 11 files changed, 6 insertions(+), 7 deletions(-) rename jrnl/plugins/exporter/{dates_exporter.py => dates.py} (100%) rename jrnl/plugins/exporter/{fancy_exporter.py => fancy.py} (100%) rename jrnl/plugins/exporter/{json_exporter.py => json.py} (100%) rename jrnl/plugins/exporter/{markdown_exporter.py => markdown.py} (100%) rename jrnl/plugins/exporter/{tag_exporter.py => tag.py} (91%) rename jrnl/plugins/exporter/{testing_exporter.py => testing.py} (100%) rename jrnl/plugins/exporter/{text_exporter.py => text.py} (100%) rename jrnl/plugins/exporter/{xml_exporter.py => xml.py} (95%) rename jrnl/plugins/exporter/{yaml_exporter.py => yaml.py} (100%) rename jrnl/plugins/importer/{jrnl_importer.py => jrnl.py} (100%) diff --git a/docs/extending-jrnl.md b/docs/extending-jrnl.md index 494bd0ce..2a78181e 100644 --- a/docs/extending-jrnl.md +++ b/docs/extending-jrnl.md @@ -49,7 +49,7 @@ entries to a Journal. Here is a basic Importer, assumed to be provided with a nicely formated JSON file: ~~~ python -# pelican\contrib\importer\json_importer.py +# pelican\contrib\importer\sample_json.py import sys from jrnl import Entry @@ -133,7 +133,7 @@ included in jrnl and so this (if installed) would override the built in exporter. ~~~ python -# pelican\contrib\exporter\custom_json_exporter.py +# pelican\contrib\exporter\custom_json.py import json from jrnl.plugins.base import BaseExporter @@ -187,7 +187,7 @@ Some implementation notes: Python interpreter running jrnl. - the exporter should expose at least the following the following members (there are a few more you will need to define if you don't subclass - `jrnl.plugins.exporter.text_exporter`): + `jrnl.plugins.base.BaseExporter`): - **version** (string): the version of the plugin. Displayed to help the user debug their installations. - **names** (list of strings): these are the "names" that can be passed to diff --git a/jrnl/plugins/exporter/dates_exporter.py b/jrnl/plugins/exporter/dates.py similarity index 100% rename from jrnl/plugins/exporter/dates_exporter.py rename to jrnl/plugins/exporter/dates.py diff --git a/jrnl/plugins/exporter/fancy_exporter.py b/jrnl/plugins/exporter/fancy.py similarity index 100% rename from jrnl/plugins/exporter/fancy_exporter.py rename to jrnl/plugins/exporter/fancy.py diff --git a/jrnl/plugins/exporter/json_exporter.py b/jrnl/plugins/exporter/json.py similarity index 100% rename from jrnl/plugins/exporter/json_exporter.py rename to jrnl/plugins/exporter/json.py diff --git a/jrnl/plugins/exporter/markdown_exporter.py b/jrnl/plugins/exporter/markdown.py similarity index 100% rename from jrnl/plugins/exporter/markdown_exporter.py rename to jrnl/plugins/exporter/markdown.py diff --git a/jrnl/plugins/exporter/tag_exporter.py b/jrnl/plugins/exporter/tag.py similarity index 91% rename from jrnl/plugins/exporter/tag_exporter.py rename to jrnl/plugins/exporter/tag.py index 561df755..a8cf932d 100644 --- a/jrnl/plugins/exporter/tag_exporter.py +++ b/jrnl/plugins/exporter/tag.py @@ -3,13 +3,14 @@ # Copyright (C) 2012-2021 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html -from jrnl.plugins.exporter.text_exporter import Exporter as TextExporter + +from jrnl.plugins.base import BaseExporter from jrnl.plugins.util import get_tags_count from ... import __version__ -class Exporter(TextExporter): +class Exporter(BaseExporter): """This Exporter can lists the tags for entries and journals, exported as a plain text file.""" names = ["tags"] diff --git a/jrnl/plugins/exporter/testing_exporter.py b/jrnl/plugins/exporter/testing.py similarity index 100% rename from jrnl/plugins/exporter/testing_exporter.py rename to jrnl/plugins/exporter/testing.py diff --git a/jrnl/plugins/exporter/text_exporter.py b/jrnl/plugins/exporter/text.py similarity index 100% rename from jrnl/plugins/exporter/text_exporter.py rename to jrnl/plugins/exporter/text.py diff --git a/jrnl/plugins/exporter/xml_exporter.py b/jrnl/plugins/exporter/xml.py similarity index 95% rename from jrnl/plugins/exporter/xml_exporter.py rename to jrnl/plugins/exporter/xml.py index 7e34d8f9..7d7f279c 100644 --- a/jrnl/plugins/exporter/xml_exporter.py +++ b/jrnl/plugins/exporter/xml.py @@ -5,14 +5,12 @@ from xml.dom import minidom -# from jrnl.plugins.exporter.json_exporter import Exporter as JSONExporter from jrnl.plugins.base import BaseExporter from jrnl.plugins.util import get_tags_count from ... import __version__ -# class Exporter(JSONExporter): class Exporter(BaseExporter): """This Exporter can convert entries and journals into XML.""" diff --git a/jrnl/plugins/exporter/yaml_exporter.py b/jrnl/plugins/exporter/yaml.py similarity index 100% rename from jrnl/plugins/exporter/yaml_exporter.py rename to jrnl/plugins/exporter/yaml.py diff --git a/jrnl/plugins/importer/jrnl_importer.py b/jrnl/plugins/importer/jrnl.py similarity index 100% rename from jrnl/plugins/importer/jrnl_importer.py rename to jrnl/plugins/importer/jrnl.py