From 7c172b733a023d87f45a59589283f544e7f52d19 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Sat, 19 Jan 2013 13:27:20 -0500 Subject: [PATCH] Fix up report_issue.py Allow it to take non-file names for the traceback file. This allows users without a traceback file to submit issues. --- report_issue.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/report_issue.py b/report_issue.py index 700687c20..a679c35d2 100755 --- a/report_issue.py +++ b/report_issue.py @@ -1,5 +1,6 @@ #!/usr/bin/env python import sys +import os from github3 import login from getpass import getpass @@ -47,7 +48,8 @@ def prompt_user(prompt_str): traceback = None if issue_type.lower() == 'bug': tb_file = prompt_user('Filename with traceback: ') - traceback = open(tb_file).read() + if os.path.isfile(tb_file): + traceback = open(tb_file).read() description = prompt_user('Description: ') @@ -70,4 +72,6 @@ def prompt_user(prompt_str): *Generated with github3.py using the report_issue script* """.format(issue_type, traceback, description) -repo.create_issue(title, body) +i = repo.create_issue(title, body) + +print(i.html_url)