From 011f0b17dd06c717966d8147ed66cdb8b0568efe Mon Sep 17 00:00:00 2001 From: Simson Garfinkel Date: Sat, 8 Dec 2012 00:02:13 -0500 Subject: Allows different username than repro --- issues.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/issues.py b/issues.py index bbb6bce..1a7ff58 100755 --- a/issues.py +++ b/issues.py @@ -8,6 +8,7 @@ import optparse parser = optparse.OptionParser(usage='Usage: %prog [options] sfexport.xml githubuser/repo') parser.add_option('-s', '--start', dest='start_id', action='store', help='id of first issue to import; useful for aborted runs') +parser.add_option('-u', '--user', dest='github_user') opts, args = parser.parse_args() try: @@ -17,6 +18,9 @@ except (ValueError, IndexError): parser.print_help() sys.exit(1) +if opts.github_user: + github_user = opts.github_user + from BeautifulSoup import BeautifulStoneSoup print 'Parsing XML export...' -- cgit v1.2.3 From 6e33f1b1bfd80173dbb5d2aa5f34a7730032fbd8 Mon Sep 17 00:00:00 2001 From: Simson Garfinkel Date: Sat, 8 Dec 2012 00:04:45 -0500 Subject: handles error if not authenticated --- issues.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/issues.py b/issues.py index 1a7ff58..d50c3b1 100755 --- a/issues.py +++ b/issues.py @@ -128,6 +128,8 @@ def handle_tracker_item(item, issue_title_prefix): print "ISSUE CAUSED SERVER SIDE ERROR AND WAS NOT SAVED!!! Import will continue." else: issue = response.json + if 'number' not in issue: + raise RuntimeError("No 'number' in issue; response %d invalid" % response.status_code) number = issue['number'] print 'Attaching labels: %s' % labels rest_call('POST', 'issues/%s/labels' % (number), labels) -- cgit v1.2.3