Skip to content

Commit

Permalink
fix trello's problem: sarumont/py-trello#373
Browse files Browse the repository at this point in the history
  • Loading branch information
zironycho committed Mar 31, 2024
1 parent c4a3ac3 commit 06a62a5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
18 changes: 15 additions & 3 deletions cli.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# -*- coding: utf-8 -*-
import yaml
import click
from trello.trelloclient import TrelloClient
from trello import TrelloClient
import accountbook
import requests

class TrelloSession(requests.Session):
def request(self, method, url, **kwargs):
if method == 'GET':
kwargs = {**kwargs, 'data': None}
return super().request(method, url, **kwargs)


@click.command()
Expand All @@ -12,12 +19,17 @@ def report(config_file):
acbook_config = yaml.load(f.read())

try:
client = TrelloClient(acbook_config['trello']['api_key'],
token=acbook_config['trello']['token'])
client = TrelloClient(
api_key=acbook_config['trello']['api_key'],
api_secret=acbook_config['trello']['api_secret'],
token=acbook_config['trello']['oauth_token'],
token_secret=acbook_config['trello']['oauth_token_secret'],
http_service=TrelloSession())
except Exception as e:
print(e)
return

# boards = client.list_boards('open')
boards = client.list_boards('open')

selected_board = None
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ humanize==0.5.1
mock==2.0.0
oauthlib==2.0.1
pbr==1.10.0
py-trello==0.6.0
# py-trello==0.6.0
py-trello
python-dateutil==2.6.0
PyYAML==3.12
requests==2.10.0
Expand Down

0 comments on commit 06a62a5

Please sign in to comment.