本文整理汇总了Python中trello.TrelloClient.list_organizations方法的典型用法代码示例。如果您正苦于以下问题:Python TrelloClient.list_organizations方法的具体用法?Python TrelloClient.list_organizations怎么用?Python TrelloClient.list_organizations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trello.TrelloClient
的用法示例。
在下文中一共展示了TrelloClient.list_organizations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: NS1Base
# 需要导入模块: from trello import TrelloClient [as 别名]
# 或者: from trello.TrelloClient import list_organizations [as 别名]
class NS1Base(object):
# https://trello.com/b/1diHBDGp/
SPRINT_BOARD_ID = '56b0bee08a91f6b079ba6ae9'
def __init__(self):
self.client = None
self._me = None
def check_api_key(self):
if not os.getenv('TRELLO_API_KEY') or not os.getenv('TRELLO_API_SECRET'):
raise Exception("You must define TRELLO_API_KEY and TRELLO_API_SECRET, from these: https://trello.com/app-key")
def check_oauth(self):
if not os.getenv('TRELLO_OAUTH_KEY') or not os.getenv('TRELLO_OAUTH_SECRET'):
self.create_oauth()
def create_oauth(self):
from trello import util
util.create_oauth_token()
sys.exit(0)
def init_client(self):
self.client = TrelloClient(api_key=os.getenv('TRELLO_API_KEY'),
api_secret=os.getenv('TRELLO_API_SECRET'),
token=os.getenv('TRELLO_OAUTH_KEY'),
token_secret=os.getenv('TRELLO_OAUTH_SECRET'))
# check for auth
try:
self.client.list_organizations()
except Unauthorized:
print "RECEIVED UNAUTHORIZED, RECREATING OAUTH"
self.create_oauth()
@property
def me(self):
if self._me:
return self._me
self._me = Member(self.client, 'me')
self._me.fetch()
return self._me
def boot(self):
self.check_api_key()
self.check_oauth()
self.init_client()