-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathissue.py
More file actions
38 lines (25 loc) · 735 Bytes
/
Copy pathissue.py
File metadata and controls
38 lines (25 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
import traceback
__all__ = [ 'new_issue', 'setup_issue' ]
IssuesUrl = 'http://github.com/{user}/{project}/issues'
class Issue(object):
User = None
Project = None
def __init__(_):
_.tb = traceback.format_exc().replace('\n', '\n ').strip()
def __str__(_):
return """\
An unexpected exception has been caught:
{}
Please log this exception and details about the YQL you are executing at:
{}
""".format(_.tb, IssuesUrl.format(user=_.User, project=_.Project))
def set_user(user):
Issue.User = user
def set_project(project):
Issue.Project = project
def setup_issue(user, project):
set_user(user)
set_project(project)
def new_issue():
return Issue()