# HG changeset patch # User Tyler G. Hicks-Wright # Date 1332372137 21600 # Wed Mar 21 17:22:17 2012 -0600 # Node ID 3100c735c8cdab6f3b7012ee05bfa0002d7e8199 # Parent 29401f60e583d1ffe95d8704314b9d5a307cc192 Add a set_token method to the main api for passing a new token along to all of the various apis. diff --git a/trello_api.mustache b/trello_api.mustache --- a/trello_api.mustache +++ b/trello_api.mustache @@ -11,5 +11,11 @@ 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')