Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
e.setMessage("Group with id %d does not exist" % group_id)
raise
content = json.loads(content)
errors = None
success = False
user = None
if 'success' in content:
success = content["success"]
if 'errors' in content:
if len(content['errors']) != 0:
errors = SplitwiseError(content['errors'])
if 'user' in content:
if content['user'] is not None:
user = Friend(content['user'])
return success, user, errors
def getFriends(self):
""" Gets the list of users friends.
Returns:
:obj:`list` of :obj:`splitwise.user.Friend`: List of Friends
"""
content = self.__makeRequest(Splitwise.GET_FRIENDS_URL)
content = json.loads(content)
friends = []
if "friends" in content:
for f in content["friends"]:
friends.append(Friend(f))
return friends
if "country_code" in data:
self.country_code = data["country_code"]
else:
self.country_code = None
self.original_debts = []
for debt in data["original_debts"]:
self.original_debts.append(Debt(debt))
self.simplified_debts = []
for debt in data["simplified_debts"]:
self.simplified_debts.append(Debt(debt))
self.members = []
for member in data["members"]:
self.members.append(Friend(member))