Move graphql_to_page -> Page._from_graphql

This commit is contained in:
Mads Marquart
2019-03-10 17:36:41 +01:00
parent fd5553a9f5
commit cb2c68e25a
4 changed files with 25 additions and 25 deletions

View File

@@ -159,27 +159,6 @@ def graphql_to_thread(thread):
)
def graphql_to_page(page):
if page.get("profile_picture") is None:
page["profile_picture"] = {}
if page.get("city") is None:
page["city"] = {}
plan = None
if page.get("event_reminders") and page["event_reminders"].get("nodes"):
plan = Plan._from_graphql(page["event_reminders"]["nodes"][0])
return Page(
page["id"],
url=page.get("url"),
city=page.get("city").get("name"),
category=page.get("category_type"),
photo=page["profile_picture"].get("uri"),
name=page.get("name"),
message_count=page.get("messages_count"),
plan=plan,
)
def graphql_queries_to_json(*queries):
"""
Queries should be a list of GraphQL objects