From 4a3e3664add099c96cf86a80f03bd554c75b4001 Mon Sep 17 00:00:00 2001 From: n Date: Sun, 7 Feb 2021 17:30:54 +0100 Subject: [PATCH] use confparser to get pleroma's options --- feed2toot/confparse.py | 5 +++++ feed2toot/confparsers/pleroma.py | 26 ++++++++++++++++++++++++++ feed2toot/tootpost.py | 12 +++--------- 3 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 feed2toot/confparsers/pleroma.py diff --git a/feed2toot/confparse.py b/feed2toot/confparse.py index 54010a2..7bede0b 100644 --- a/feed2toot/confparse.py +++ b/feed2toot/confparse.py @@ -34,6 +34,7 @@ from feed2toot.confparsers.hashtags.nohashtags import parsenotagsintoot from feed2toot.confparsers.feedparser import parsefeedparser from feed2toot.confparsers.lock import parselock from feed2toot.confparsers.media import parsemedia +from feed2toot.confparsers.pleroma import parsepleroma from feed2toot.confparsers.plugins import parseplugins from feed2toot.confparsers.rss.ignoressl import parseignoressl from feed2toot.confparsers.rss.pattern import parsepattern @@ -113,6 +114,10 @@ class ConfParse: ########################### options['media'] = parsemedia(config) ########################### + # the pleroma section + ########################### + options['mastodon_feature_set'], options['toot_content_type'] = parsepleroma(config) + ########################### # the plugins section ########################### plugins = parseplugins(config) diff --git a/feed2toot/confparsers/pleroma.py b/feed2toot/confparsers/pleroma.py new file mode 100644 index 0000000..42ee81c --- /dev/null +++ b/feed2toot/confparsers/pleroma.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Copyright © 2015-2020 Carl Chenet +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see