mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
2to3 apps/rss_feeds
This commit is contained in:
parent
6021afaec3
commit
34e017721b
5 changed files with 7 additions and 7 deletions
|
@ -37,12 +37,12 @@ class Command(BaseCommand):
|
||||||
usersubs = UserSubscription.objects.filter(user=u, active=True)
|
usersubs = UserSubscription.objects.filter(user=u, active=True)
|
||||||
else:
|
else:
|
||||||
usersubs = UserSubscription.objects.filter(user=u, needs_unread_recalc=True)
|
usersubs = UserSubscription.objects.filter(user=u, needs_unread_recalc=True)
|
||||||
print(" ---> %s has %s feeds (%s/%s)" % (u.username, usersubs.count(), i+1, user_count))
|
print((" ---> %s has %s feeds (%s/%s)" % (u.username, usersubs.count(), i+1, user_count)))
|
||||||
for sub in usersubs:
|
for sub in usersubs:
|
||||||
try:
|
try:
|
||||||
sub.calculate_feed_scores(silent=options['silent'])
|
sub.calculate_feed_scores(silent=options['silent'])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(" ***> Exception: %s" % e)
|
print((" ***> Exception: %s" % e))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
def daemonize():
|
def daemonize():
|
||||||
|
|
|
@ -20,4 +20,4 @@ class Command(BaseCommand):
|
||||||
for feed in feeds:
|
for feed in feeds:
|
||||||
feed.count_stories(verbose=options['verbose'])
|
feed.count_stories(verbose=options['verbose'])
|
||||||
|
|
||||||
print("\nCounted %s feeds" % feeds.count())
|
print(("\nCounted %s feeds" % feeds.count()))
|
|
@ -30,5 +30,5 @@ class Command(BaseCommand):
|
||||||
for feed in old_feeds:
|
for feed in old_feeds:
|
||||||
feed.count_subscribers(verbose=True)
|
feed.count_subscribers(verbose=True)
|
||||||
if feed.num_subscribers == 0:
|
if feed.num_subscribers == 0:
|
||||||
print(' ---> Deleting: [%s] %s' % (feed.pk, feed))
|
print((' ---> Deleting: [%s] %s' % (feed.pk, feed)))
|
||||||
feed.delete()
|
feed.delete()
|
|
@ -4,4 +4,4 @@ import redis
|
||||||
from apps.social.models import *
|
from apps.social.models import *
|
||||||
|
|
||||||
r = redis.Redis(connection_pool=settings.REDIS_FEED_UPDATE_POOL)
|
r = redis.Redis(connection_pool=settings.REDIS_FEED_UPDATE_POOL)
|
||||||
print("Redis: %s" % r)
|
print(("Redis: %s" % r))
|
|
@ -183,9 +183,9 @@ class FeedTest(TestCase):
|
||||||
old_story_guid = "blog.google:443/topics/inside-google/google-earths-incredible-3d-imagery-explained/"
|
old_story_guid = "blog.google:443/topics/inside-google/google-earths-incredible-3d-imagery-explained/"
|
||||||
|
|
||||||
management.call_command('loaddata', 'google1.json', verbosity=1, skip_checks=False)
|
management.call_command('loaddata', 'google1.json', verbosity=1, skip_checks=False)
|
||||||
print(Feed.objects.all())
|
print((Feed.objects.all()))
|
||||||
feed = Feed.objects.get(pk=766)
|
feed = Feed.objects.get(pk=766)
|
||||||
print(" Testing test_load_feeds__google: %s" % feed)
|
print((" Testing test_load_feeds__google: %s" % feed))
|
||||||
stories = MStory.objects(story_feed_id=feed.pk)
|
stories = MStory.objects(story_feed_id=feed.pk)
|
||||||
self.assertEqual(stories.count(), 0)
|
self.assertEqual(stories.count(), 0)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue