From 9170cc4794e93b0d758c46e82585ea8fd8292fd5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Fri, 29 Aug 2014 19:26:33 +0200 Subject: [PATCH] [Migration] remove unused podcasts.py --- mygpo/core/podcasts.py | 22 ---------------------- mygpo/maintenance/management/podcastcmd.py | 6 ++---- mygpo/web/views/settings.py | 4 ---- 3 files changed, 2 insertions(+), 30 deletions(-) delete mode 100644 mygpo/core/podcasts.py diff --git a/mygpo/core/podcasts.py b/mygpo/core/podcasts.py deleted file mode 100644 index cb75014d..00000000 --- a/mygpo/core/podcasts.py +++ /dev/null @@ -1,22 +0,0 @@ -from mygpo.podcasts.models import Podcast, PodcastGroup - - -# the default sort order for podcasts -PODCAST_SORT=lambda p: p.display_title - - -def lazy_call(f, *args, **kwargs): - for x in f(*args, **kwargs): - yield x - - -def individual_podcasts(pg): - """ returns individual podcasts for an iter of Podcast(Group) objects """ - - for p in pg: - if isinstance(p, Podcast): - yield p - - elif isinstance(p, PodcastGroup): - for x in p.podcast_set.all(): - yield x diff --git a/mygpo/maintenance/management/podcastcmd.py b/mygpo/maintenance/management/podcastcmd.py index e5c1fb21..7369f176 100644 --- a/mygpo/maintenance/management/podcastcmd.py +++ b/mygpo/maintenance/management/podcastcmd.py @@ -4,7 +4,6 @@ import random from django.core.management.base import BaseCommand -from mygpo.core.podcasts import individual_podcasts from mygpo.podcasts.models import Podcast @@ -50,7 +49,7 @@ class PodcastCommand(BaseCommand): if options.get('random'): podcasts = random_podcasts() - yield (p.url for p in individual_podcasts(podcasts)) + yield (p.url for p in podcasts) if options.get('next'): podcasts = Podcast.objects.all().order_by_next_update()[:max_podcasts] @@ -68,8 +67,7 @@ class PodcastCommand(BaseCommand): def get_toplist(self, max_podcasts=100): - toplist = Podcast.objects.all().toplist() - return individual_podcasts(p for i, p in toplist[:max_podcasts]) + return Podcast.objects.all().toplist()[:max_podcasts] def random_podcasts(): diff --git a/mygpo/web/views/settings.py b/mygpo/web/views/settings.py index 72369479..21842100 100644 --- a/mygpo/web/views/settings.py +++ b/mygpo/web/views/settings.py @@ -31,7 +31,6 @@ from django.views.generic.base import View from django.utils.html import strip_tags from mygpo.podcasts.models import Podcast -from mygpo.core.podcasts import PODCAST_SORT from mygpo.subscriptions.models import PodcastConfig from mygpo.decorators import allowed_methods, repeat_on_conflict from mygpo.web.forms import UserAccountForm, ProfileForm, FlattrForm @@ -267,9 +266,6 @@ def privacy(request): subscriptions.append( (podcast, podcast in private) ) -#subs = set((podcasts.get(x[1], None), not x[0]) for x in subscriptions) -#subs = sorted(subs, key=lambda (p, _): PODCAST_SORT(p)) - return render(request, 'privacy.html', { 'private_subscriptions': not request.user.profile.get_wksetting(PUBLIC_SUB_USER), 'subscriptions': subscriptions, -- 2.11.4.GIT