Merge lp:~submarine/ubuntu-scopes/sshsearch-to-deprecatedscope-api into lp:~submarine/ubuntu-scopes/sshsearch

Proposed by David Callé
Status: Merged
Approved by: Didier Roche-Tolomelli
Approved revision: 4
Merged at revision: 3
Proposed branch: lp:~submarine/ubuntu-scopes/sshsearch-to-deprecatedscope-api
Merge into: lp:~submarine/ubuntu-scopes/sshsearch
Diff against target: 297 lines (+139/-21)
14 files modified
.bzr-builddeb/default.conf (+2/-0)
MANIFEST.in (+4/-0)
data/sshsearch.scope.in (+6/-4)
data/unity-scope-sshsearch.service (+1/-1)
debian/changelog (+10/-0)
debian/compat (+1/-0)
debian/control (+34/-0)
debian/copyright (+23/-0)
debian/rules (+18/-0)
debian/source/format (+1/-0)
po/unity-scope-sshsearch.pot (+3/-3)
setup.cfg (+6/-0)
setup.py (+16/-0)
src/unity_sshsearch_daemon.py (+14/-13)
To merge this branch: bzr merge lp:~submarine/ubuntu-scopes/sshsearch-to-deprecatedscope-api
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
James Henstridge Approve
Review via email: mp+153882@code.launchpad.net

Commit message

Port to DeprecatedScope

Description of the change

- Port to the DeprecatedScope API
- Package

To post a comment you must log in.
4. By Didier Roche-Tolomelli

* Rename and port of unity-lens-sshsearch
* Fix packaging
* Transition from unity-lens-sshsearch to this package

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

adding some packaging fixes + translation handling.

Revision history for this message
James Henstridge (jamesh) wrote :

The code changes look good. I see that the tests only handle the internal update_results_model() method. Would it make sense to test the external API of the scope too?

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory '.bzr-builddeb'
2=== added file '.bzr-builddeb/default.conf'
3--- .bzr-builddeb/default.conf 1970-01-01 00:00:00 +0000
4+++ .bzr-builddeb/default.conf 2013-03-18 17:57:23 +0000
5@@ -0,0 +1,2 @@
6+[BUILDDEB]
7+split = True
8
9=== added file 'MANIFEST.in'
10--- MANIFEST.in 1970-01-01 00:00:00 +0000
11+++ MANIFEST.in 2013-03-18 17:57:23 +0000
12@@ -0,0 +1,4 @@
13+include MANIFEST.in
14+include src/*
15+include data/*
16+include po/*
17
18=== modified file 'data/sshsearch.scope.in'
19--- data/sshsearch.scope.in 2013-01-29 07:41:51 +0000
20+++ data/sshsearch.scope.in 2013-03-18 17:57:23 +0000
21@@ -1,11 +1,13 @@
22 [Scope]
23-DBusName=com.canonical.Unity.Scope.Connections.Sshsearch
24-DBusPath=/com/canonical/unity/scope/connections/sshsearch
25+DBusName=com.canonical.Unity.Scope.Boxes.Sshsearch
26+DBusPath=/com/canonical/unity/scope/boxes/sshsearch
27 Icon=
28-_Keywords=sshsearch;
29+Loader=/usr/share/unity-scopes/sshsearch/unity_sshsearch_daemon.py
30+_Keywords=sshsearch;ssh;connections;
31 RequiredMetadata=
32 OptionalMetadata=
33-Type=connections
34+RemoteContent=false
35+Type=boxes
36 _Name=Sshsearch
37 _Description=Find Sshsearch items
38 _SearchHint=Search Sshsearch
39
40=== modified file 'data/unity-scope-sshsearch.service'
41--- data/unity-scope-sshsearch.service 2013-01-28 01:50:41 +0000
42+++ data/unity-scope-sshsearch.service 2013-03-18 17:57:23 +0000
43@@ -1,3 +1,3 @@
44 [D-BUS Service]
45 Name=com.canonical.Unity.Scope.Connections.Sshsearch
46-Exec=/usr/lib/ubuntu-scopes/sshsearch/unity_sshsearch_daemon.py
47+Exec=/usr/share/unity-scopes/sshsearch/unity_sshsearch_daemon.py
48
49=== added directory 'debian'
50=== added file 'debian/changelog'
51--- debian/changelog 1970-01-01 00:00:00 +0000
52+++ debian/changelog 2013-03-18 17:57:23 +0000
53@@ -0,0 +1,10 @@
54+unity-scope-sshsearch (0.1) UNRELEASED; urgency=low
55+
56+ [ Mark Tully ]
57+ * Rename and port of unity-lens-sshsearch
58+
59+ [ Didier Roche ]
60+ * Fix packaging
61+ * Transition from unity-lens-sshsearch to this package
62+
63+ -- Mark Tully <markjtully@gmail.com> Mon, 18 Mar 2013 18:24:36 +0100
64
65=== added file 'debian/compat'
66--- debian/compat 1970-01-01 00:00:00 +0000
67+++ debian/compat 2013-03-18 17:57:23 +0000
68@@ -0,0 +1,1 @@
69+9
70
71=== added file 'debian/control'
72--- debian/control 1970-01-01 00:00:00 +0000
73+++ debian/control 2013-03-18 17:57:23 +0000
74@@ -0,0 +1,34 @@
75+Source: unity-scope-sshsearch
76+Section: gnome
77+Priority: optional
78+Maintainer: Mark Tully <markjtully@gmail.com>
79+Build-Depends: debhelper (>= 9),
80+ python,
81+ python-distutils-extra,
82+ python-gi,
83+ pkg-config,
84+ python-nose,
85+ gir1.2-unity-5.0 (>= 6.91),
86+ gir1.2-glib-2.0,
87+ python-paramiko,
88+Standards-Version: 3.9.4
89+Homepage: https://launchpad.net/unity-scope-sshsearch
90+# If you aren't a member of ~submarine but need to upload packaging changes,
91+# just go ahead. ~submarine will notice and sync up the code again.
92+Vcs-Bzr: https://code.launchpad.net/~submarine/unity-scope-sshsearch/trunk
93+
94+Package: unity-scope-sshsearch
95+Architecture: all
96+Depends: ${misc:Depends},
97+ ${python:Depends},
98+ python,
99+ python-gi,
100+ gir1.2-unity-5.0 (>= 6.91),
101+ gir1.2-glib-2.0,
102+ python-paramiko,
103+Conflicts: unity-lens-sshsearch,
104+Replaces: unity-lens-sshsearch,
105+Provides: unity-lens-sshsearch,
106+Description: ssh search scope for Unity
107+ This package contains the "sshsearch" scope which allows Unity
108+ to search for configured ssh connexions.
109
110=== added file 'debian/copyright'
111--- debian/copyright 1970-01-01 00:00:00 +0000
112+++ debian/copyright 2013-03-18 17:57:23 +0000
113@@ -0,0 +1,23 @@
114+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
115+Source: https://launchpad.net/unity-scope-sshsearch
116+Upstream-Name: unity-scope-sshsearch
117+Upstream-Contact: Mark Tully <markjtully@gmail.com>
118+
119+Files: *
120+Copyright: 2012 Bernd Schlapsi
121+ 2013 Mark Tully
122+License: GPL-3
123+ This program is free software: you can redistribute it and/or modify
124+ it under the terms of the GNU General Public License as published by
125+ the Free Software Foundation, version 3 of the License.
126+ .
127+ This program is distributed in the hope that it will be useful,
128+ but WITHOUT ANY WARRANTY; without even the implied warranty of
129+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
130+ GNU General Public License for more details.
131+ .
132+ You should have received a copy of the GNU General Public License
133+ along with this program. If not, see <http://www.gnu.org/licenses/>.
134+ .
135+ On Debian systems, the complete text of the GNU General
136+ Public License version 3 can be found in '/usr/share/common-licenses/GPL-3'.
137
138=== added file 'debian/rules'
139--- debian/rules 1970-01-01 00:00:00 +0000
140+++ debian/rules 2013-03-18 17:57:23 +0000
141@@ -0,0 +1,18 @@
142+#!/usr/bin/make -f
143+# -*- makefile -*-
144+
145+
146+%:
147+ dh $@ --with python2
148+
149+override_dh_auto_clean:
150+ python setup.py clean -a
151+
152+override_dh_auto_build:
153+ python setup.py build
154+
155+override_dh_auto_test:
156+ nosetests
157+
158+override_dh_auto_install:
159+ python setup.py install --root=$(CURDIR)/debian/unity-scope-sshsearch --install-layout=deb
160
161=== added directory 'debian/source'
162=== added file 'debian/source/format'
163--- debian/source/format 1970-01-01 00:00:00 +0000
164+++ debian/source/format 2013-03-18 17:57:23 +0000
165@@ -0,0 +1,1 @@
166+1.0
167
168=== modified file 'po/unity-scope-sshsearch.pot'
169--- po/unity-scope-sshsearch.pot 2013-01-29 07:41:51 +0000
170+++ po/unity-scope-sshsearch.pot 2013-03-18 17:57:23 +0000
171@@ -8,7 +8,7 @@
172 msgstr ""
173 "Project-Id-Version: PACKAGE VERSION\n"
174 "Report-Msgid-Bugs-To: \n"
175-"POT-Creation-Date: 2013-01-29 08:30+0100\n"
176+"POT-Creation-Date: 2013-03-18 18:23+0100\n"
177 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
178 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
179 "Language-Team: LANGUAGE <LL@li.org>\n"
180@@ -18,7 +18,7 @@
181 "Content-Transfer-Encoding: 8bit\n"
182
183 #: ../src/unity_sshsearch_daemon.py:34
184-msgid "Categorytitle"
185+msgid "Boxes"
186 msgstr ""
187
188 #: ../src/unity_sshsearch_daemon.py:36
189@@ -30,7 +30,7 @@
190 msgstr ""
191
192 #: ../data/sshsearch.scope.in.h:1
193-msgid "sshsearch;"
194+msgid "sshsearch;ssh;connections;"
195 msgstr ""
196
197 #: ../data/sshsearch.scope.in.h:2
198
199=== added file 'setup.cfg'
200--- setup.cfg 1970-01-01 00:00:00 +0000
201+++ setup.cfg 2013-03-18 17:57:23 +0000
202@@ -0,0 +1,6 @@
203+[build]
204+i18n=True
205+
206+[build_i18n]
207+domain=unity-scope-sshsearch
208+desktop_files=[('share/unity/scopes/boxes', ('data/sshsearch.scope.in',))]
209
210=== added file 'setup.py'
211--- setup.py 1970-01-01 00:00:00 +0000
212+++ setup.py 2013-03-18 17:57:23 +0000
213@@ -0,0 +1,16 @@
214+#!/usr/bin/env python3
215+# -*- coding: utf-8 -*-
216+from distutils.core import setup
217+from DistUtilsExtra.command import *
218+
219+setup(name='unity-scope-sshsearch',
220+ version='0.1',
221+ author='Mark Tully',
222+ author_email='markjtully@gmail.com',
223+ url='http://launchpad.net/ubuntu-scopes',
224+ license='GNU General Public License (GPL)',
225+ data_files=[
226+ ('share/dbus-1/services', ['data/unity-scope-sshsearch.service']),
227+ ('share/unity-scopes/sshsearch', ['src/unity_sshsearch_daemon.py']),
228+ ], cmdclass={'build': build_extra.build_extra,
229+ 'build_i18n': build_i18n.build_i18n,})
230
231=== modified file 'src/unity_sshsearch_daemon.py'
232--- src/unity_sshsearch_daemon.py 2013-01-28 01:50:41 +0000
233+++ src/unity_sshsearch_daemon.py 2013-03-18 17:57:23 +0000
234@@ -1,7 +1,8 @@
235 #! /usr/bin/python
236 # -*- coding: utf-8 -*-
237
238-# Copyright(C) 2012 name <email>
239+# Copyright(C) 2013 Mark Tully <markjtully@gmail.com>
240+# Copyright(C) 2012 Bernd Schlapsi <brot@gmx.info>
241 # This program is free software: you can redistribute it and/or modify it
242 # under the terms of the GNU General Public License version 3, as published
243 # by the Free Software Foundation.
244@@ -26,12 +27,12 @@
245 gettext.textdomain(APP_NAME)
246 _ = gettext.gettext
247
248-BUS_NAME = 'com.canonical.Unity.Scope.Connections.Sshsearch'
249-BUS_PATH = '/com/canonical/unity/scope/connections/sshsearch'
250+BUS_NAME = 'com.canonical.Unity.Scope.Boxes.Sshsearch'
251+BUS_PATH = '/com/canonical/unity/scope/boxes/sshsearch'
252
253 SVG_DIR = '/usr/share/icons/unity-icon-theme/places/svg/'
254-CAT_0_ICON = Gio.ThemedIcon.new(SVG_DIR + 'group-connections.svg')
255-CAT_0_TITLE = _('Categorytitle')
256+CAT_0_ICON = Gio.ThemedIcon.new(SVG_DIR + 'group-boxes.svg')
257+CAT_0_TITLE = _('Boxes')
258
259 NO_RESULTS_HINT = _('Sorry, there are no available SSH connections that match your search.')
260 SEARCH_HINT = _('Search for available SSH connections')
261@@ -48,14 +49,14 @@
262
263 class Daemon:
264 def __init__(self):
265- self.scope = Unity.Scope.new(BUS_PATH, 'sshsearch')
266+ self.scope = Unity.DeprecatedScope.new(BUS_PATH, 'sshsearch')
267 self.scope.props.search_hint = SEARCH_HINT
268 self.scope.search_in_global = True
269- cats = []
270- cats.append(Unity.Category.new(CAT_0_TITLE.lower(),
271- CAT_0_TITLE,
272- CAT_0_ICON,
273- Unity.CategoryRenderer.VERTICAL_TILE))
274+ cats = Unity.CategorySet.new()
275+ cats.add(Unity.Category.new(CAT_0_TITLE.lower(),
276+ CAT_0_TITLE,
277+ CAT_0_ICON,
278+ Unity.CategoryRenderer.VERTICAL_TILE))
279 self.scope.props.categories = cats
280 self.preferences = Unity.PreferencesManager.get_default()
281 self.preferences.connect('notify::remote-content-search', self._on_preference_changed)
282@@ -112,14 +113,14 @@
283 model = search.props.results_model
284 model.clear()
285 if self.preferences.props.remote_content_search != Unity.PreferencesManagerRemoteContent.ALL:
286- search.finished()
287+ search.emit('finished')
288 return
289 search_string = search.props.search_string.strip()
290 print('Search changed to \'%s\'' % search_string)
291 self.update_results_model(search_string, model)
292 search.set_reply_hint('no-results-hint',
293 GLib.Variant.new_string(NO_RESULTS_HINT))
294- search.finished()
295+ search.emit('finished')
296
297 def update_results_model(self, search, results):
298

Subscribers

People subscribed via source and target branches

to all changes: