remove dependency on persistentlist because unstable and use own storage
This commit is contained in:
parent
770b3e3e1e
commit
dffd5c8c36
3 changed files with 57 additions and 5 deletions
|
@ -26,7 +26,6 @@ import sys
|
|||
|
||||
# 3rd party libraries imports
|
||||
import feedparser
|
||||
from persistentlist import PersistentList
|
||||
|
||||
# app libraries imports
|
||||
from feed2toot.addtags import AddTags
|
||||
|
@ -35,6 +34,7 @@ from feed2toot.confparse import ConfParse
|
|||
from feed2toot.filterentry import FilterEntry
|
||||
from feed2toot.removeduplicates import RemoveDuplicates
|
||||
from feed2toot.tootpost import TootPost
|
||||
from feed2toot.feedcache import FeedCache
|
||||
|
||||
class Main(object):
|
||||
'''Main class of Feed2toot'''
|
||||
|
@ -73,8 +73,8 @@ class Main(object):
|
|||
tweetformat = conf[2]
|
||||
feeds = conf[3]
|
||||
plugins = conf[4]
|
||||
# open the persistent list
|
||||
cache = PersistentList(options['cachefile'][0:-3], options['cache_limit'])
|
||||
# create link to the persistent list
|
||||
cache = FeedCache(options)
|
||||
if options['hashtaglist']:
|
||||
severalwordshashtags = codecs.open(options['hashtaglist'],
|
||||
encoding='utf-8').readlines()
|
||||
|
@ -97,7 +97,7 @@ class Main(object):
|
|||
# cache the ids of last rss feeds
|
||||
if not clioptions.all:
|
||||
for i in entries:
|
||||
if 'id' in i and i['id'] not in cache:
|
||||
if 'id' in i and i['id'] not in cache.getdeque():
|
||||
totweet.append(i)
|
||||
else:
|
||||
totweet = entries
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue