mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-19 04:28:31 +02:00
[plugins] meta --> collector
This commit is contained in:
parent
0e5748a8e6
commit
65914e2073
5 changed files with 14 additions and 12 deletions
|
@ -462,7 +462,7 @@ def load_template(context, filename):
|
||||||
full_path = os.path.join("features/data/templates", filename)
|
full_path = os.path.join("features/data/templates", filename)
|
||||||
|
|
||||||
exporter = plugins.template_exporter.__exporter_from_file(full_path)
|
exporter = plugins.template_exporter.__exporter_from_file(full_path)
|
||||||
plugins.meta.__exporter_types[exporter.names[0]] = exporter
|
plugins.collector.__exporter_types[exporter.names[0]] = exporter
|
||||||
|
|
||||||
|
|
||||||
@when('we set the keyring password of "{journal}" to "{password}"')
|
@when('we set the keyring password of "{journal}" to "{password}"')
|
||||||
|
|
|
@ -13,8 +13,8 @@ from .commands import preconfig_diagnostic
|
||||||
from .commands import preconfig_version
|
from .commands import preconfig_version
|
||||||
from .output import deprecated_cmd
|
from .output import deprecated_cmd
|
||||||
from .plugins import util
|
from .plugins import util
|
||||||
from .plugins.meta import EXPORT_FORMATS
|
from .plugins.collector import EXPORT_FORMATS
|
||||||
from .plugins.meta import IMPORT_FORMATS
|
from .plugins.collector import IMPORT_FORMATS
|
||||||
|
|
||||||
|
|
||||||
class WrappingFormatter(argparse.RawTextHelpFormatter):
|
class WrappingFormatter(argparse.RawTextHelpFormatter):
|
||||||
|
|
|
@ -28,7 +28,7 @@ def preconfig_diagnostic(_):
|
||||||
def preconfig_version(_):
|
def preconfig_version(_):
|
||||||
from jrnl import __title__
|
from jrnl import __title__
|
||||||
from jrnl import __version__
|
from jrnl import __version__
|
||||||
from jrnl.plugins.meta import (
|
from jrnl.plugins.collector import (
|
||||||
IMPORT_FORMATS,
|
IMPORT_FORMATS,
|
||||||
EXPORT_FORMATS,
|
EXPORT_FORMATS,
|
||||||
get_exporter,
|
get_exporter,
|
||||||
|
@ -69,7 +69,7 @@ def postconfig_list(config, **kwargs):
|
||||||
|
|
||||||
def postconfig_import(args, config, **kwargs):
|
def postconfig_import(args, config, **kwargs):
|
||||||
from .Journal import open_journal
|
from .Journal import open_journal
|
||||||
from .plugins.meta import get_importer
|
from .plugins.collector import get_importer
|
||||||
|
|
||||||
# Requires opening the journal
|
# Requires opening the journal
|
||||||
journal = open_journal(args.journal_name, config)
|
journal = open_journal(args.journal_name, config)
|
||||||
|
|
10
jrnl/jrnl.py
10
jrnl/jrnl.py
|
@ -324,17 +324,17 @@ def _delete_search_results(journal, old_entries, **kwargs):
|
||||||
|
|
||||||
def _display_search_results(args, journal, **kwargs):
|
def _display_search_results(args, journal, **kwargs):
|
||||||
if args.short or args.export == "short":
|
if args.short or args.export == "short":
|
||||||
print(plugins.meta.get_exporter("short").export(journal))
|
print(plugins.collector.get_exporter("short").export(journal))
|
||||||
|
|
||||||
elif args.tags:
|
elif args.tags:
|
||||||
print(plugins.meta.get_exporter("tags").export(journal))
|
print(plugins.collector.get_exporter("tags").export(journal))
|
||||||
|
|
||||||
elif args.export:
|
elif args.export:
|
||||||
exporter = plugins.meta.get_exporter(args.export)
|
exporter = plugins.collector.get_exporter(args.export)
|
||||||
print(exporter.export(journal, args.filename))
|
print(exporter.export(journal, args.filename))
|
||||||
elif kwargs["config"].get("display_format"):
|
elif kwargs["config"].get("display_format"):
|
||||||
exporter = plugins.meta.get_exporter(kwargs["config"]["display_format"])
|
exporter = plugins.collector.get_exporter(kwargs["config"]["display_format"])
|
||||||
print(exporter.export(journal, args.filename))
|
print(exporter.export(journal, args.filename))
|
||||||
else:
|
else:
|
||||||
# print(journal.pprint())
|
# print(journal.pprint())
|
||||||
print(plugins.meta.get_exporter("default").export(journal))
|
print(plugins.collector.get_exporter("default").export(journal))
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
# License: https://www.gnu.org/licenses/gpl-3.0.html
|
# License: https://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
|
||||||
"""
|
"""
|
||||||
This file ("meta") uses that title in the reflexive sense; i.e. it is the
|
Code relating to the collecting of plugins and distributing calls to them.
|
||||||
collection of code that allows plugins to deal with themselves.
|
|
||||||
|
|
||||||
In particular, the code here collects the list of imports and exporters, both
|
In particular, the code here collects the list of imports and exporters, both
|
||||||
internal and external, and tells the main program which plugins are available.
|
internal and external, and tells the main program which plugins are available.
|
||||||
|
@ -14,6 +13,9 @@ functions are importable/callable at predetermined (code) locations.
|
||||||
|
|
||||||
Internal plugins are located in the `jrnl.plugins` namespace, and external
|
Internal plugins are located in the `jrnl.plugins` namespace, and external
|
||||||
plugins are located in the `jrnl.contrib` namespace.
|
plugins are located in the `jrnl.contrib` namespace.
|
||||||
|
|
||||||
|
This file was originally called "meta", using that title in the reflexive sense;
|
||||||
|
i.e. it is the collection of code that allows plugins to deal with themselves.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import importlib
|
import importlib
|
Loading…
Add table
Reference in a new issue