cleaning some code (from MR #9)

This commit is contained in:
Carl Chenet 2017-08-01 16:57:08 +02:00
parent 3aef77acac
commit 65242b02cf
3 changed files with 8 additions and 28 deletions

View file

@ -17,15 +17,9 @@
'''Filter an entry of the RSS feeds'''
# standard library imports
from configparser import SafeConfigParser, NoOptionError, NoSectionError
import os
import os.path
import sys
# 3rd party library imports
import feedparser
class FilterEntry(object):
class FilterEntry:
'''FilterEntry class'''
def __init__(self, elements, entry, options, byrsspatterns, rssobject, feedname):
'''Constructor of the FilterEntry class'''

View file

@ -21,12 +21,8 @@ import codecs
import importlib
import logging
import logging.handlers
import os
import sys
# 3rd party libraries imports
import feedparser
# app libraries imports
from feed2toot.addtags import AddTags
from feed2toot.cliparse import CliParse
@ -36,7 +32,7 @@ from feed2toot.removeduplicates import RemoveDuplicates
from feed2toot.tootpost import TootPost
from feed2toot.feedcache import FeedCache
class Main(object):
class Main:
'''Main class of Feed2toot'''
def __init__(self):

View file

@ -15,16 +15,7 @@
"""Checks an RSS feed and posts new entries to Mastodon."""
# standard libraires imports
from configparser import SafeConfigParser, NoOptionError, NoSectionError
from argparse import ArgumentParser
import codecs
import logging
import os
import sys
# 3rd party libraries imports
import feedparser
from mastodon import Mastodon
class TootPost:
@ -44,9 +35,8 @@ class TootPost:
access_token=self.config.get('mastodon', 'user_credentials'),
api_base_url=self.config.get('mastodon', 'instance_url')
)
mastodon.status_post(self.toot,
visibility=self.config.get(
'mastodon', 'toot_visibility', fallback='public'))
toot_visibility = self.config.get('mastodon', 'toot_visibility', fallback='public')
mastodon.status_post(self.toot, visibility=toot_visibility)
def storeit(self):
'''Indicate if the tweet should be stored or not'''