-
Notifications
You must be signed in to change notification settings - Fork 0
/
py_trello.py
71 lines (50 loc) · 1.48 KB
/
py_trello.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# -*- coding: utf-8 -*-
from org.transcrypt.stubs.browser import __pragma__
__pragma__("skip")
Trello = 0
__pragma__("noskip")
class pyTrello:
def startup(self):
print("Eureka!!!")
def do_authenticate(self):
def authenticationSuccess(*args):
print("authenticationSuccess")
def authenticationFailure(*args):
print("authenticationFailure")
print("do_authenticate")
Trello.authorize({
"type" : "popup",
"name": 'Getting Started Application',
"persist": "false",
"scope": {
"read": "true",
"write": "true" },
"expiration": "never",
"success": authenticationSuccess,
"error": authenticationFailure
})
def do_get_my_cards(self):
card_fields = ["id", "desc", "descData", "due", "email", "name", "subscribed", "url"]
def searchSuccess(data, result, *args):
print("searchSuccess: {}".format(result))
for item in data.cards:
for f in card_fields:
try:
print("{}: {}".format(f,item[f]))
except:
print("no {} property".format(f))
def searchFailure(*args):
print("searchFailure")
print("do_get_my_cards")
Trello.rest(
"GET",
"search",
{ "query": "@me",
"modelTypes": "cards",
"card_fields": ",".join(card_fields),
"cards_limit": "100"
},
searchSuccess,
searchFailure
)
trello = pyTrello()