def update(number, params={}): assigneedic = assignees() trackerdic = trackers() statusdic = statuses() comment = u'\n'.join( (u'Available assignees: {0}', u'Available labels: {1}', u'Available priorities: 3-7 (low to high)', u'Available states: {2}')).format( u', '.join(x['login'] for x in assigneedic.itervalues()), u', '.join(trackerdic.itervalues()), u', '.join(statusdic.itervalues())) tic, _ = issue(number, params) tic.priority = tic.priority_id # FIXME: monkey patch template = ticket.template( ('title', 'assignee', 'labels', 'priority', 'state', 'body', 'notes'), tic, comment=comment) val = util.inputwitheditor(template) if val == template: return data = _issuedata_from_template(val) cfg = config.parseconfig() _request('put', ISSUE.format(issueid=number, **cfg), data=json.dumps(data), params=params, headers={'content-type': 'application/json'})
def add(params={}): assigneedic = assignees() trackerdic = trackers() statusdic = statuses() comment = u'\n'.join( (u'Available assignees: {0}', u'Available labels: {1}', u'Available priorities: 3-7 (low to high)', u'Available states: {2}')).format( u', '.join(x['login'] for x in assigneedic.itervalues()), u', '.join(trackerdic.itervalues()), u', '.join(statusdic.itervalues())) template = ticket.template( ('title', 'assignee', 'labels', 'priority', 'state', 'body'), comment=comment) val = util.inputwitheditor(template) if val == template: return data = _issuedata_from_template(val) cfg = config.parseconfig() data['issue']['project_id'] = cfg['repo'] r = _request('post', ISSUES.format(**cfg), data=json.dumps(data), params=params, headers={'content-type': 'application/json'})['issue'] return { 'number': r['id'], 'html_url': ISSUE_URL.format(issueid=r['id'], **cfg) }
def commentto(number, params={}): template = """# comment below here\n""" val = util.inputwitheditor(template) data = {'body': util.rmcomment(val)} cfg = config.parseconfig() _request('post', ISSUE_COMMENTS.format(issueid=number, **cfg), data=json.dumps(data), params=params)
def update(number, params={}): tic = issue(number, params) comment = u'Available labels (select one): bug, enhancement, proposal, task\nAvailable priorities: trivial, minor, major, critical, blocker' template = ticket.template(('title', 'assignee', 'labels', 'state', 'priority', 'milestone', 'version', 'component', 'body'), tic, comment=comment) val = util.inputwitheditor(template) if val == template: return data = _issuedata_from_template(val) cfg = config.parseconfig() _request('put', ISSUE.format(issueid=number, **cfg), data=data, params=params)
def add(params={}): comment = u'Available labels (select one): bug, enhancement, proposal, task\nAvailable priorities: trivial, minor, major, critical, blocker' template = ticket.template(('title', 'assignee', 'labels', 'priority', 'milestone', 'version', 'component', 'body'), comment=comment) val = util.inputwitheditor(template) if val == template: return data = _issuedata_from_template(val) cfg = config.parseconfig() r = _request('post', ISSUES.format(**cfg), data=data, params=params) return {'number': r['local_id'], 'html_url': ISSUEURL.format(issueid=r['local_id'], **cfg)}
def add(params={}): comment = 'Available assignees: {0}\nAvailable labels: {1}'.format(u', '.join(labels()), u', '.join(assignees())) template = ticket.template(('title', 'assignee', 'labels', 'milestone_id', 'body'), comment=comment) val = util.inputwitheditor(template) if val == template: return data = _issuedata_from_template(val) cfg = config.parseconfig() r = _request('post', ISSUES.format(**cfg), data=json.dumps(data), params=params) return r
def update(number, params={}): tic = issue(number, params) comment = 'Available assignees: {0}\nAvailable labels: {1}'.format(u', '.join(labels()), u', '.join(assignees())) template = ticket.template(('title', 'state', 'assignee', 'labels', 'milestone_id', 'body'), tic, comment=comment) val = util.inputwitheditor(template) if val == template: return data = _issuedata_from_template(val) cfg = config.parseconfig() _request('patch', ISSUE.format(issueid=number, **cfg), data=json.dumps(data), params=params)
def commentto(number, params={}): template = """# comment below here\n""" val = util.inputwitheditor(template) data = {'notes': util.rmcomment(val)} cfg = config.parseconfig() _request('put', ISSUE.format(issueid=number, **cfg), data=json.dumps(data), params=params, headers={'content-type': 'application/json'})
def add(params={}): comment = 'Available assignees: {0}\nAvailable labels: {1}'.format( u', '.join(labels()), u', '.join(assignees())) template = ticket.template( ('title', 'assignee', 'labels', 'milestone_id', 'body'), comment=comment) val = util.inputwitheditor(template) if val == template: return data = _issuedata_from_template(val) cfg = config.parseconfig() r = _request('post', ISSUES.format(**cfg), data=json.dumps(data), params=params) return r
def update(number, params={}): tic = issue(number, params) comment = 'Available assignees: {0}\nAvailable labels: {1}'.format( u', '.join(labels()), u', '.join(assignees())) template = ticket.template( ('title', 'state', 'assignee', 'labels', 'milestone_id', 'body'), tic, comment=comment) val = util.inputwitheditor(template) if val == template: return data = _issuedata_from_template(val) cfg = config.parseconfig() _request('patch', ISSUE.format(issueid=number, **cfg), data=json.dumps(data), params=params)
def update(number, params={}): assigneedic = assignees() trackerdic = trackers() statusdic = statuses() comment = u'\n'.join((u'Available assignees: {0}', u'Available labels: {1}', u'Available priorities: 3-7 (low to high)', u'Available states: {2}') ).format(u', '.join(x['login'] for x in assigneedic.itervalues()), u', '.join(trackerdic.itervalues()), u', '.join(statusdic.itervalues())) tic, _ = issue(number, params) tic.priority = tic.priority_id # FIXME: monkey patch template = ticket.template(('title', 'assignee', 'labels', 'priority', 'state', 'body', 'notes'), tic, comment=comment) val = util.inputwitheditor(template) if val == template: return data = _issuedata_from_template(val) cfg = config.parseconfig() _request('put', ISSUE.format(issueid=number, **cfg), data=json.dumps(data), params=params, headers={'content-type': 'application/json'})
def add(params={}): assigneedic = assignees() trackerdic = trackers() statusdic = statuses() comment = u'\n'.join((u'Available assignees: {0}', u'Available labels: {1}', u'Available priorities: 3-7 (low to high)', u'Available states: {2}') ).format(u', '.join(x['login'] for x in assigneedic.itervalues()), u', '.join(trackerdic.itervalues()), u', '.join(statusdic.itervalues())) template = ticket.template(('title', 'assignee', 'labels', 'priority', 'state', 'body'), comment=comment) val = util.inputwitheditor(template) if val == template: return data = _issuedata_from_template(val) cfg = config.parseconfig() data['issue']['project_id'] = cfg['repo'] r = _request('post', ISSUES.format(**cfg), data=json.dumps(data), params=params, headers={'content-type': 'application/json'})['issue'] return {'number':r['id'], 'html_url':ISSUE_URL.format(issueid=r['id'], **cfg)}
def commentto(number, params={}): template = """# comment below here\n""" val = util.inputwitheditor(template) data = {'content': util.rmcomment(val)} cfg = config.parseconfig() _request('post', ISSUE_COMMENTS.format(issueid=number, **cfg), data=data)