Trello » TrelloPy
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

Add a set_token method to the main api for passing a new token along to all of the various apis.

Changeset 3100c735c8cd

Parent 29401f60e583

by Profile picture of User 10Tyler G. Hicks-Wright <tghw@fogcreek.com>

Changes to one file · Browse files at 3100c735c8cd Showing diff from parent 29401f60e583 Diff from another changeset...

Change 1 of 1 Show Changes Only trello_api.mustache Stacked
1
2
3
4
5
6
7
8
9
10
11
12
13
 
 
 
 
 
 
14
15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 from urllib import quote_plus  {{#sections}}  from .{{module}} import {{class}}  {{/sections}}    class TrelloApi(object):   def __init__(self, apikey, token=None):   self._apikey = apikey   self._token = token   {{#sections}}   self.{{module}} = {{class}}(apikey, token)   {{/sections}}   + def set_token(self, token): + self._token = token + {{#sections}} + self.{{module}}._token = token + {{/sections}} +   def get_token_url(self, app_name, expires='30days', write_access=True):   return 'https://trello.com/1/authorize?key=%s&name=%s&expiration=%s&response_type=token&scope=%s' % (self._apikey, quote_plus(app_name), expires, 'read,write' if write_access else 'read')