Use snake case convention

This commit is contained in:
2FWAH
2018-06-12 07:55:16 +02:00
committed by GitHub
parent 0048e82151
commit 71608845c0

View File

@@ -482,18 +482,18 @@ class Client(object):
:rtype: list :rtype: list
:raises: FBchatException if request failed :raises: FBchatException if request failed
""" """
Threads = [] threads = []
Threads += self.fetchThreadList(thread_location=thread_location) threads += self.fetchThreadList(thread_location=thread_location)
if len(Threads) == 0: if len(threads) == 0:
return [] return []
while True: while True:
lastThreadTimestamp = Threads[-1].last_message_timestamp lastThreadTimestamp = threads[-1].last_message_timestamp
candidates = self.fetchThreadList(before=lastThreadTimestamp, thread_location=thread_location) # return at max 20 threads before lastThreadTimestamp (included) candidates = self.fetchThreadList(before=lastThreadTimestamp, thread_location=thread_location) # return at max 20 threads before lastThreadTimestamp (included)
if len(candidates) > 1: if len(candidates) > 1:
Threads += candidates[1:] threads += candidates[1:]
else: else:
break break
return Threads # from newest to oldest return threads # from newest to oldest
def fetchAllUsersFromThreads(self, threads): def fetchAllUsersFromThreads(self, threads):
""" """
@@ -504,18 +504,18 @@ class Client(object):
:rtype: list :rtype: list
:raises: FBchatException if request failed :raises: FBchatException if request failed
""" """
Users = [] users = []
for thread in threads: for thread in threads:
if thread.type == ThreadType.USER: if thread.type == ThreadType.USER:
if thread.uid not in [user.uid for user in Users]: if thread.uid not in [user.uid for user in users]:
Users.append(thread) users.append(thread)
elif thread.type == ThreadType.GROUP: elif thread.type == ThreadType.GROUP:
for userID in thread.participants: for userID in thread.participants:
if userID not in [user.uid for user in Users]: if userID not in [user.uid for user in users]:
Users.append(self.fetchUserInfo(userID)[userID]) users.append(self.fetchUserInfo(userID)[userID])
else: else:
pass pass
return Users return users
def fetchAllUsers(self): def fetchAllUsers(self):
""" """