Skip to content

Instantly share code, notes, and snippets.

@sc68cal
Created April 23, 2011 20:41
Show Gist options
  • Save sc68cal/938959 to your computer and use it in GitHub Desktop.
Save sc68cal/938959 to your computer and use it in GitHub Desktop.
Dynamsoft Issue -> Github Issues
from github2.client import Github
import csv
import sys
import re
project = sys.argv[4]
github = Github(username=sys.argv[2], api_token=sys.argv[3],requests_per_second=.25)
data = csv.reader(open(sys.argv[1]))
for row in data:
body_text ="""
Imported from Dynamsoft Issue Tracker, issue %s \n
Created By: %s
Assigned To: %s
Created: %s
Changed: %s
""" % (row[0],row[4],row[3],row[5],row[6])
new_issue = github.issues.open(project, title=row[1],body=body_text)
if row[2] != "Active":
github.issues.close(project,new_issue.number)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment