Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding reasonable status message for update feeds to denote progress

  • Loading branch information...
commit ab43b85039fb7d7c4d1c238f8c028a0d06d41421 1 parent a039f0d
@justinabrahms justinabrahms authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 django_website/aggregator/management/commands/update_feeds.py
View
5 django_website/aggregator/management/commands/update_feeds.py
@@ -32,9 +32,10 @@ def handle(self, *args, **kwargs):
os.unlink(self.LOCKFILE)
def update_feeds(self, verbose=False):
- for feed in Feed.objects.filter(is_defunct=False):
+ total = Feed.objects.filter(is_defunct=False).count()
+ for count, feed in enumerate(Feed.objects.filter(is_defunct=False)):
if verbose:
- print feed
+ print "%s (%d/%d)" % (feed, count+1, total)
parsed_feed = feedparser.parse(feed.feed_url)
for entry in parsed_feed.entries:
title = entry.title.encode(parsed_feed.encoding, "xmlcharrefreplace")
Please sign in to comment.
Something went wrong with that request. Please try again.