def issue(number, params={}): cfg = config.parseconfig() params['include'] = u','.join(('journals', 'children', 'changesets')) r = _request('get', ISSUE.format(issueid=number, **cfg), params=params)['issue'] comments = [ticket.Comment(**_parse_journal(x)) for x in reversed(r['journals'])] tic = _toticket(r) return tic, comments
def comments(number, params={}): cfg = config.parseconfig() cj = _request('get', ISSUE_COMMENTS.format(issueid=number, **cfg), {'limit':50}) cj = [x for x in cj if x['content'] is not None] # commentは特殊。statusの変更がコメント化され、Web上では表示できるが、APIからは補足できない。 comments = [ticket.Comment(number = x['comment_id'], body = x['content'], creator = nested_access(x, 'author_info.username'), created = _todatetime(x['utc_created_on']), updated = _todatetime(x['utc_updated_on'])) for x in cj] return comments
def comments(number, params={}): cfg = config.parseconfig() r = _request('get', ISSUE_COMMENTS.format(issueid=number, **cfg), params=params) comments = [ ticket.Comment(number=x['id'], body=x['body'], creator=nested_access(x, 'user.login'), created=todatetime(x['created_at']), updated=todatetime(x['updated_at'])) for x in r ] return comments