CLI: Make episode list output pageable
This commit is contained in:
parent
dea3395b1e
commit
fa766b4ee4
1 changed files with 5 additions and 2 deletions
7
bin/gpo
7
bin/gpo
|
@ -219,15 +219,18 @@ class gPodderCli(object):
|
||||||
|
|
||||||
@FirstArgumentIsPodcastURL
|
@FirstArgumentIsPodcastURL
|
||||||
def episodes(self, url=None):
|
def episodes(self, url=None):
|
||||||
|
output = []
|
||||||
for podcast in self.client.get_podcasts():
|
for podcast in self.client.get_podcasts():
|
||||||
podcast_printed = False
|
podcast_printed = False
|
||||||
if url is None or podcast.url == url:
|
if url is None or podcast.url == url:
|
||||||
episodes = self._episodesList(podcast)
|
episodes = self._episodesList(podcast)
|
||||||
episodes = '\n '.join(episodes)
|
episodes = '\n '.join(episodes)
|
||||||
print >>sys.stdout, """
|
output.append("""
|
||||||
Episodes from %s:
|
Episodes from %s:
|
||||||
%s
|
%s
|
||||||
""" % (podcast.url, episodes)
|
""" % (podcast.url, episodes))
|
||||||
|
|
||||||
|
self._pager('\n'.join(output))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def list(self):
|
def list(self):
|
||||||
|
|
Loading…
Reference in a new issue