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

@@ -746,7 +746,7 @@ class Client(object):
GraphQL(query=GraphQL.SEARCH_PAGE, params={"search": name, "limit": limit})
)
return [graphql_to_page(node) for node in j[name]["pages"]["nodes"]]
return [Page._from_graphql(node) for node in j[name]["pages"]["nodes"]]
def searchForGroups(self, name, limit=10):
"""
@@ -790,7 +790,7 @@ class Client(object):
# MessageThread => Group thread
rtn.append(Group._from_graphql(node))
elif node["__typename"] == "Page":
rtn.append(graphql_to_page(node))
rtn.append(Page._from_graphql(node))
elif node["__typename"] == "Group":
# We don't handle Facebook "Groups"
pass
@@ -1058,7 +1058,7 @@ class Client(object):
if entry["type"] == ThreadType.USER:
rtn[_id] = User._from_graphql(entry)
else:
rtn[_id] = graphql_to_page(entry)
rtn[_id] = Page._from_graphql(entry)
else:
raise FBchatException(
"{} had an unknown thread type: {}".format(thread_ids[i], entry)