コード例 #1
0
ファイル: redmine.py プロジェクト: carlos-wong/git-ticket
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'})
コード例 #2
0
ファイル: redmine.py プロジェクト: carlos-wong/git-ticket
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)
    }
コード例 #3
0
ファイル: bitbucket.py プロジェクト: Wanyi-Xu/git-ticket
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)
コード例 #4
0
ファイル: bitbucket.py プロジェクト: Wanyi-Xu/git-ticket
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)}
コード例 #5
0
ファイル: github.py プロジェクト: Wanyi-Xu/git-ticket
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
コード例 #6
0
ファイル: github.py プロジェクト: Wanyi-Xu/git-ticket
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)
コード例 #7
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)
コード例 #8
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)}
コード例 #9
0
ファイル: github.py プロジェクト: carlos-wong/git-ticket
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
コード例 #10
0
ファイル: github.py プロジェクト: carlos-wong/git-ticket
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)
コード例 #11
0
ファイル: redmine.py プロジェクト: carlos-wong/git-ticket
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'})
コード例 #12
0
ファイル: redmine.py プロジェクト: carlos-wong/git-ticket
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)}