Exemple #1
0
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'})
Exemple #2
0
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)
    }
Exemple #3
0
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)
Exemple #4
0
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)
Exemple #5
0
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)}
Exemple #6
0
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
Exemple #7
0
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)
Exemple #8
0
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)
Exemple #9
0
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)}
Exemple #10
0
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'})
Exemple #11
0
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
Exemple #12
0
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)
Exemple #13
0
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'})
Exemple #14
0
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)}
Exemple #15
0
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)
Exemple #16
0
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'})