1
0
mirror of https://github.com/ihabunek/toot synced 2024-12-23 15:37:47 +01:00

Mark function as private

This commit is contained in:
Ivan Habunek 2019-02-13 14:19:27 +01:00
parent 19cbcd43b2
commit a3ebd96e05
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95

View File

@ -151,7 +151,7 @@ def context(app, user, status_id):
return http.get(app, user, url).json()
def get_next_path(headers):
def _get_next_path(headers):
"""Given timeline response headers, returns the path to the next batch"""
links = headers.get('Link', '')
matches = re.match('<([^>]+)>; rel="next"', links)
@ -164,7 +164,7 @@ def _timeline_generator(app, user, path, params=None):
while path:
response = http.get(app, user, path, params)
yield response.json()
path = get_next_path(response.headers)
path = _get_next_path(response.headers)
def _anon_timeline_generator(instance, path, params=None):
@ -172,7 +172,7 @@ def _anon_timeline_generator(instance, path, params=None):
url = "https://{}{}".format(instance, path)
response = http.anon_get(url, params)
yield response.json()
path = get_next_path(response.headers)
path = _get_next_path(response.headers)
def home_timeline_generator(app, user, limit=20):