mirror of https://gitlab.com/chaica/feed2toot
Merge branch 'master' into 'master'
Draft: Ensure cache is closed/saved on MastodonAPIError See merge request chaica/feed2toot!22
This commit is contained in:
commit
9beb5d65bf
|
@ -16,16 +16,18 @@
|
|||
|
||||
"""Checks an RSS feed and posts new entries to Mastodon."""
|
||||
|
||||
# standard libraires imports
|
||||
# standard libraries imports
|
||||
import codecs
|
||||
import importlib
|
||||
import logging
|
||||
import logging.handlers
|
||||
import sys
|
||||
import re
|
||||
import traceback
|
||||
|
||||
# external liraries imports
|
||||
# external libraries imports
|
||||
from bs4 import BeautifulSoup
|
||||
from mastodon.errors import MastodonAPIError
|
||||
|
||||
# app libraries imports
|
||||
from feed2toot.addtags import AddTags
|
||||
|
@ -74,6 +76,7 @@ class Main:
|
|||
# iterating over the different configuration files
|
||||
cfgp = ConfParse(clioptions)
|
||||
confs = cfgp.confvalues
|
||||
try:
|
||||
for conf in confs:
|
||||
options = conf[0]
|
||||
config = conf[1]
|
||||
|
@ -124,6 +127,9 @@ class Main:
|
|||
# plugins
|
||||
if plugins and entrytosend:
|
||||
activate_plugins(plugins, finaltweet)
|
||||
except MastodonAPIError:
|
||||
traceback.print_exc()
|
||||
|
||||
# do not forget to close cache (shelf object)
|
||||
cache.close()
|
||||
# release the lock file
|
||||
|
|
Loading…
Reference in New Issue