Merge lp:~ted/lptools/review-changes into lp:~dobey/lptools/trunk

Proposed by Ted Gould
Status: Superseded
Proposed branch: lp:~ted/lptools/review-changes
Merge into: lp:~dobey/lptools/trunk
Diff against target: None lines
To merge this branch: bzr merge lp:~ted/lptools/review-changes
Reviewer Review Type Date Requested Status
dobey Pending
Review via email: mp+9710@code.launchpad.net

This proposal has been superseded by a proposal from 2009-09-12.

To post a comment you must log in.
lp:~ted/lptools/review-changes updated
22. By Ted Gould

Merging in from trunk

23. By Ted Gould

Ripping out our config file and using the same one as review-list

24. By Ted Gould

Using the thread code from the review-list

25. By Ted Gould

Switching around the property names to match the v2 naming for the messaging indicator.

26. By Ted Gould

Making it so that clicking on the main menu item brings up the list.

27. By Ted Gould

Merging in the worker queue branch.

Unmerged revisions

27. By Ted Gould

Merging in the worker queue branch.

26. By Ted Gould

Making it so that clicking on the main menu item brings up the list.

25. By Ted Gould

Switching around the property names to match the v2 naming for the messaging indicator.

24. By Ted Gould

Using the thread code from the review-list

23. By Ted Gould

Ripping out our config file and using the same one as review-list

22. By Ted Gould

Merging in from trunk

21. By Ted Gould

Merge in license info

20. By Ted Gould

Merging from trunk

19. By Ted Gould

A better review URL

18. By Ted Gould

Make a callback to brink up a webbrowser

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2009-07-27 14:21:21 +0000
3+++ README 2009-08-03 13:59:48 +0000
4@@ -1,5 +1,5 @@
5-This is a temporary repository with some review tools for the Ubuntu One
6-projects.
7+This is a temporary repository with some review tools for projects on
8+Launchpad.
9
10 review-notifier <project1> [[project2] ...]
11
12@@ -10,10 +10,9 @@
13 review-list <project1> [[project2] ...]
14
15 This tool will present a list of all the branches currently in the
16-Needs Review state. It includes the current list of Ubuntu One projects to
17-monitor, and additional projects can be passed in on the command line. The
18-list includes the branch name, and the votes on the proposal. You can
19-double-click on a row to open the merge proposal page in your browser.
20+Needs Review state. The list includes the branch name, and the votes
21+on the proposal. You can double-click on a row to open the merge
22+proposal page in your browser.
23
24
25 Both tools use launchpadlib, and refresh automatically every 5 minutes
26
27=== modified file 'review-list'
28--- review-list 2009-07-29 18:41:26 +0000
29+++ review-list 2009-08-05 18:19:07 +0000
30@@ -14,6 +14,7 @@
31 import sys
32
33 from xdg.BaseDirectory import xdg_cache_home
34+from xdg.BaseDirectory import xdg_config_home
35
36 from threading import Thread
37
38@@ -84,23 +85,30 @@
39
40 self.me = self.launchpad.me
41
42- print "Allo, %s" % self.me.name
43 self.show()
44
45 # Need to move this to a config file instead of hardcoding
46- self.projects = [ "ubunet",
47- "ubuntuone-storage-protocol",
48- "ubuntuone-client",
49- "ubuntuone-testing",
50- "desktopcouch",
51- "bindwood",
52- "couchdb-glib",
53- "evolution-couchdb",
54- ]
55+ self.projects = [ ]
56 for arg in sys.argv:
57 if arg is not sys.argv[0]:
58 self.projects.append(arg)
59
60+ projectlst = os.path.join(xdg_config_home, "review-tools", "project-list")
61+ try:
62+ f = open(projectlst)
63+ prjlist = f.readlines()
64+ for i in prjlist:
65+ self.projects.append(i.strip())
66+ f.close
67+ except IOError:
68+ print "IO Error"
69+ except:
70+ pass
71+
72+ if len(self.projects) == 0:
73+ print "No projects specified"
74+ sys.exit(1)
75+
76 self.thread = None
77
78 self.__timeout()
79
80=== modified file 'review-notifier'
81--- review-notifier 2009-07-27 14:20:10 +0000
82+++ review-notifier 2009-08-05 00:50:01 +0000
83@@ -11,20 +11,38 @@
84
85 import os
86 import sys
87+import subprocess
88
89 from xdg.BaseDirectory import xdg_cache_home
90+from xdg.BaseDirectory import xdg_config_home
91
92 from launchpadlib.launchpad import Launchpad, EDGE_SERVICE_ROOT
93 from launchpadlib.credentials import Credentials
94
95+import indicate
96+from time import time
97+
98 ICON_NAME = "bzr-icon-64"
99
100+def indicator_display (indicator):
101+ name = indicator.get_property("sender")
102+ url = "http://code.launchpad.net/" + name + "/+activereviews"
103+ ret = subprocess.call(["xdg-open", url])
104+ if ret != 0:
105+ sys.stderr.write("Failed to run 'xdg-open %s'\n" % url)
106+
107 class Main(object):
108
109 def __init__(self):
110 self.id = 0
111 self.cached_candidates = {}
112
113+ self.indicators = { }
114+ server = indicate.indicate_server_ref_default()
115+ server.set_type("message.instant")
116+ server.set_desktop_file(os.path.join(os.getcwd(), "review-tools.desktop"))
117+ server.show()
118+
119 self.cachedir = os.path.join(xdg_cache_home, "review-notifier")
120 credsfile = os.path.join(self.cachedir, "credentials")
121
122@@ -45,14 +63,37 @@
123
124 self.me = self.launchpad.me
125
126- print "Allo, %s" % self.me.name
127-
128 self.projects = []
129
130 for arg in sys.argv:
131 if not arg.endswith("review-notifier"):
132 self.projects.append(arg)
133
134+ projectlst = os.path.join(xdg_config_home, "review-tools", "project-list")
135+ try:
136+ f = open(projectlst)
137+ prjlist = f.readlines()
138+ for i in prjlist:
139+ self.projects.append(i.strip())
140+ f.close
141+ except IOError:
142+ print "IO Error"
143+ except:
144+ pass
145+
146+ if len(self.projects) == 0:
147+ print "No Projects specified"
148+ sys.exit(1)
149+
150+ for project in self.projects:
151+ ind = indicate.IndicatorMessage()
152+ ind.set_property("subtype", "im")
153+ ind.set_property("sender", project)
154+ ind.set_property_time("time", time())
155+ ind.connect("user-display", indicator_display)
156+ ind.hide()
157+ self.indicators[project] = ind
158+
159 pynotify.init("Review Notifier")
160 self.timeout()
161
162@@ -77,6 +118,7 @@
163 trunk = focus
164
165 if trunk.landing_candidates:
166+ self.indicators[project].show()
167 for c in trunk.landing_candidates:
168 c_name = c.source_branch.unique_name
169 status = None
170@@ -131,9 +173,13 @@
171
172 if updated:
173 n.set_urgency(pynotify.URGENCY_LOW)
174+ n.set_hint("x-canonical-append", "allow")
175 n.show()
176+ self.indicators[project].set_property_time("time", time())
177 else:
178 n.close()
179+ else:
180+ self.indicators[project].hide()
181
182 return True
183
184
185=== added file 'review-tools.desktop'
186--- review-tools.desktop 1970-01-01 00:00:00 +0000
187+++ review-tools.desktop 2009-08-04 23:32:09 +0000
188@@ -0,0 +1,10 @@
189+[Desktop Entry]
190+Encoding=UTF-8
191+Name=Launchpad Reviews
192+GenericName=Code Review Notifier
193+Comment=Notify when new code reviews appear
194+Exec=review-list
195+StartupNotify=true
196+Terminal=false
197+Type=Application
198+Categories=Network;

Subscribers

People subscribed via source and target branches

to all changes: