Skip to content

Commit

Permalink
Update trello.py
Browse files Browse the repository at this point in the history
Update trello.py
  • Loading branch information
Ctri-The-Third committed Mar 17, 2022
1 parent 830a36c commit 649c529
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions trello.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,8 @@ def add_item_to_checklist(self, checklistID, text):
return
return

def fetch_checklist_content(self, checklist_id):
url = "https://api.trello.com/1/checklists/%s" % (checklist_id)
params = self._get_trello_params()
r = requests.get(url=url,params=params)
if r.status_code != 200:
lo.error("Couldn't fetch checklist content %s" % (r.status_code, r.content))


def delete_checklist_item(self,checklist_id, checklist_item_id):
url = "https://api.trello.com/1/checklists/%s/checkItems/%s" % (checklist_id,checklist_id,checklist_item_id)
url = "https://api.trello.com/1/checklists/%s/checkItems/%s" % (checklist_id,checklist_item_id)
params = self._get_trello_params()
r = requests.delete(url,params=params)
if r.status_code != 200:
Expand Down Expand Up @@ -230,3 +222,15 @@ def deleteTrelloCard(self,trelloCardID):
print(r.reason)



def fetch_checklist_content(self, checklist_id) ->list:
url = "https://api.trello.com/1/checklists/%s" % (checklist_id)
params = self._get_trello_params()
r = requests.get(url=url,params=params)
if r.status_code != 200:
lo.error("Couldn't fetch checklist content %s" % (r.status_code, r.content))
try:
content = json.loads(r.content)["checkItems"]
except Exception as e:
lo.error(f"Couldn't parse the json from the fetch_checklist_content method for {checklist_id}")
return content

0 comments on commit 649c529

Please sign in to comment.