-
Notifications
You must be signed in to change notification settings - Fork 0
/
phab_project_notes.py
executable file
·54 lines (40 loc) · 1.04 KB
/
phab_project_notes.py
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python
import sys
from phabricator import Phabricator
if len(sys.argv) == 1:
print "Syntax: %s ProjectName" % sys.argv[0]
sys.exit(1)
project_name = sys.argv[1]
phab = Phabricator()
phab.update_interfaces()
proj = phab.project
def phid_from_name(name):
all_projects = proj.query()
for phid in all_projects:
if all_projects[phid]['name'] == name:
return phid
projectPHID = phid_from_name(project_name)
tasks = phab.maniphest.find(
projectPHIDs=[projectPHID],
)
print "Project %s" % project_name
# Currently unused, exists for reference
status = {
'0': 'any',
'1': 'open',
'2': 'closed',
'3': 'resolved',
'4': 'wontfix',
'5': 'invalid',
'6': 'spite',
'7': 'duplicate',
}
for task in tasks:
# Include non-open tasks
# "any" appears to also contain open tasks :(
if tasks[task]['status'] in ['0', '2', '3']:
print "P:%s %s %s" % (
tasks[task]['priority'],
tasks[task]['title'],
tasks[task]['uri'],
)