Add comments about generator functions
This commit is contained in:
parent
8c73b186be
commit
0508d92475
10
main.py
10
main.py
|
|
@ -75,22 +75,30 @@ def get_url(**kwargs):
|
|||
def get_categories():
|
||||
"""
|
||||
Get the list of video categories.
|
||||
|
||||
Here you can insert some parsing code that retrieves
|
||||
the list of video categories (e.g. 'Movies', 'TV-shows', 'Documentaries' etc.)
|
||||
from some site or server.
|
||||
|
||||
.. note:: Consider using `generator functions <https://wiki.python.org/moin/Generators>`_
|
||||
instead of returning lists.
|
||||
|
||||
:return: The list of video categories
|
||||
:rtype: list
|
||||
"""
|
||||
return VIDEOS.keys()
|
||||
return VIDEOS.iterkeys()
|
||||
|
||||
|
||||
def get_videos(category):
|
||||
"""
|
||||
Get the list of videofiles/streams.
|
||||
|
||||
Here you can insert some parsing code that retrieves
|
||||
the list of video streams in the given category from some site or server.
|
||||
|
||||
.. note:: Consider using `generators functions <https://wiki.python.org/moin/Generators>`_
|
||||
instead of returning lists.
|
||||
|
||||
:param category: Category name
|
||||
:type category: str
|
||||
:return: the list of videos in the category
|
||||
|
|
|
|||
Loading…
Reference in New Issue