(auth, filename='etc/default_tickets.csv')
Creates tickets in Github issues.
Creates tickets in Github issues.
Creates tickets in Github issues .
def create_tickets(auth, filename='etc/default_tickets.csv'):
    """
    Creates tickets in Github issues.
    """
    url = 'https://api.github.com/repos/%s/issues' % get_repo_path()

    with open(filename) as f:
        tickets = list(csv.DictReader(f))

    print 'Creating %i tickets' % len(tickets)

    for ticket in tickets:
        print 'Creating ticket "%s"' % ticket['title']

        if ticket['labels']:
            ticket['labels'] = ticket['labels'].split(',')
        else:
            ticket['labels'] = []

        ticket['labels'].append('Default Ticket')

        data = json.dumps(ticket)

        requests.post(url, data=data, auth=auth)
def create_tickets ( auth , filename = 'etc/default_tickets.csv' ) : url = 'https://api.github.com/repos/%s/issues' % get_repo_path ( ) with open ( filename ) as f : tickets = list ( csv . DictReader ( f ) ) print 'Creating %i tickets' % len ( tickets ) for ticket in tickets : print 'Creating ticket "%s"' % ticket [ 'title' ] if ticket [ 'labels' ] : ticket [ 'labels' ] = ticket [ 'labels' ] . split ( ',' ) else : ticket [ 'labels' ] = [ ] ticket [ 'labels' ] . append ( 'Default Ticket' ) data = json . dumps ( ticket ) requests . post ( url , data = data , auth = auth )