本文整理汇总了Python中trello.TrelloClient.me方法的典型用法代码示例。如果您正苦于以下问题:Python TrelloClient.me方法的具体用法?Python TrelloClient.me怎么用?Python TrelloClient.me使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trello.TrelloClient
的用法示例。
在下文中一共展示了TrelloClient.me方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from trello import TrelloClient [as 别名]
# 或者: from trello.TrelloClient import me [as 别名]
def main():
usage = '%prog (load|rebuild|commit|push|test|config|update)'\
' [options] args... are you ready?'
parser = OptionParser(usage)
parser.add_option('-i', '--id',
type='int',
dest='id')
parser.add_option('-u', '--user',
dest='user')
parser.add_option('-c', '--comment',
dest='comment')
parser.add_option('-g', '--gitpath',
default=realpath(__file__),
dest='gitpath')
parser.add_option('-p', '--params',
dest='params')
parser.add_option('-t', '--title',
dest='title')
parser.add_option('-d', '--description',
dest='description',
default="")
(options, args) = parser.parse_args()
repo = Repo(options.gitpath)
conf_path = join(expanduser("~"), '.gitr.json')
if not len(args):
handle_error(msg='Some action are required', handle=parser)
if not isfile(conf_path):
conf_src = join(dirname(realpath(__file__)), 'gitr.json')
shutil.copy(conf_src, conf_path)
with open(conf_path, 'r') as infile:
json_data = json.load(infile)
BOARD_ID = json_data['BOARD_ID']
CREATE_LIST_ID = json_data['CREATE_LIST_ID']
DONE_LIST_ID = json_data['DONE_LIST_ID']
MEMBERS = json_data['MEMBERS']
USER = MEMBERS[int(json_data['USER'])]
client = TrelloClient(api_key=json_data['API_KEY'],
token=json_data['TOKEN'],
api_secret=json_data['API_SECRET'])
if ('update' in args):
create_list = client.get_list(CREATE_LIST_ID)
card = get_current_card(repo, create_list)
if options.description:
card._set_remote_attribute('description', options.description)
if options.title or options.params:
def sub_match(match):
match_args = [arg for arg in match.groups()]
if options.title:
match_args[4] = options.title
if options.params:
params = check_params(options.params)
if (len(params) > 2):
match_args[2] = params[2]
elif (len(params) == 2):
match_args[1] = params[1]
match_args[3] = params[0]
return '#%s. %sº (%s,%s) %s' % tuple(match_args)
name = re.sub('#(\d+).(\d+)º \((\d+),(\d+)\) (.*)', sub_match, card.name)
card._set_remote_attribute('name', name)
elif ('members' in args):
for idx, member_id in enumerate(MEMBERS):
member = client.get_member(member_id)
logging.info("*%s %d. %s (%s)" % ((USER == member_id) and '*' or '',
idx, member.username, member.full_name))
elif ('config' in args):
if options.params:
params = options.params.split(',')
for param in params:
try:
key, value = param.split(':')
#.........这里部分代码省略.........