Skip to content

Commit

Permalink
Merge pull request #3 from Ctri-The-Third/habitica
Browse files Browse the repository at this point in the history
Habitica updates
  • Loading branch information
Ctri-The-Third authored Mar 18, 2022
2 parents 649c529 + 06aefe2 commit cf7e72e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
4 changes: 0 additions & 4 deletions freshdesk.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,6 @@ def get_worklogs(self,ticketID):


url = 'https://%s/api/v2/tickets/%s/time_entries' % (self.host,ticketID)
<<<<<<< HEAD
=======

>>>>>>> 9251d5b9adf5e5c462589e7ef30ed9343ab8f572
AuthString = "Basic %s" % (self.api_key)
r = requests.get (
url,
Expand Down
3 changes: 2 additions & 1 deletion habitica.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import json
from typing import List
import requests

lo = logging.getLogger("HabiticaMapper")
Expand All @@ -9,7 +10,7 @@ def __init__(self,user_id,api_key) -> None:
self.user_id = user_id
self.api_key = api_key

def fetchHabiticaDailies(self,dateAsString):
def fetchHabiticaDailies(self,dateAsString) -> list:
url = "https://habitica.com/api/v3/tasks/user?type=dailys&dueDate=%s" % (dateAsString)
headers = self._getHabiticaHeaders()

Expand Down
1 change: 1 addition & 0 deletions jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def from_dict(self,new_dict:dict):
self.key = new_dict["key"] if "key" in new_dict else self.key
self.summary = fields["summary"] if "summary" in fields else self.summary
self.description = fields["description"] if "description" in fields else self.description
self.assignee_id = assignee_dict["key"] if "key" in assignee_dict else self.assignee_id
self.assignee_id = assignee_dict["accountId"] if "accountId" in assignee_dict else self.assignee_id
self.assignee_name = assignee_dict["displayName"] if "displayName" in assignee_dict else self.assignee_name
self.priority = priority_dict["name"] if "name" in priority_dict else self.priority
Expand Down
18 changes: 17 additions & 1 deletion trello.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import json
import urllib

from soupsieve import match



lo = logging.getLogger("TrelloHelper")
Expand All @@ -32,7 +34,21 @@ def find_trello_cards(self,regex):
if re.search(regex,card["name"]) or re.search(regex,card["desc"]):
foundCards.append(card)
return foundCards


def search_trello_cards(self,search_criteria,board_id = None) -> list:
"uses the trello search criteria, can return archived cards"
url = "https://api.trello.com/1/search"
params = self._get_trello_params()
params['card_fields'] = 'desc, name'
params['modelTypes'] = 'cards'
if board_id:
params["idBoards"] = board_id
params["query"] = search_criteria
r = requests.get(url, params = params)
matching_summaries = json.loads(r.content)["cards"]
return matching_summaries


def purge_trello_cards(self,titlePattern = "", descPattern = "", targetLists = []
, customFieldIDs = []):
"""
Expand Down

0 comments on commit cf7e72e

Please sign in to comment.