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
=== added directory '.bzr-builddeb'
=== added file '.bzr-builddeb/default.conf'
--- .bzr-builddeb/default.conf 1970-01-01 00:00:00 +0000
+++ .bzr-builddeb/default.conf 2013-03-18 17:57:23 +0000
@@ -0,0 +1,2 @@
1[BUILDDEB]
2split = True
03
=== added file 'MANIFEST.in'
--- MANIFEST.in 1970-01-01 00:00:00 +0000
+++ MANIFEST.in 2013-03-18 17:57:23 +0000
@@ -0,0 +1,4 @@
1include MANIFEST.in
2include src/*
3include data/*
4include po/*
05
=== modified file 'data/sshsearch.scope.in'
--- data/sshsearch.scope.in 2013-01-29 07:41:51 +0000
+++ data/sshsearch.scope.in 2013-03-18 17:57:23 +0000
@@ -1,11 +1,13 @@
1[Scope]1[Scope]
2DBusName=com.canonical.Unity.Scope.Connections.Sshsearch2DBusName=com.canonical.Unity.Scope.Boxes.Sshsearch
3DBusPath=/com/canonical/unity/scope/connections/sshsearch3DBusPath=/com/canonical/unity/scope/boxes/sshsearch
4Icon=4Icon=
5_Keywords=sshsearch;5Loader=/usr/share/unity-scopes/sshsearch/unity_sshsearch_daemon.py
6_Keywords=sshsearch;ssh;connections;
6RequiredMetadata=7RequiredMetadata=
7OptionalMetadata=8OptionalMetadata=
8Type=connections9RemoteContent=false
10Type=boxes
9_Name=Sshsearch11_Name=Sshsearch
10_Description=Find Sshsearch items12_Description=Find Sshsearch items
11_SearchHint=Search Sshsearch13_SearchHint=Search Sshsearch
1214
=== modified file 'data/unity-scope-sshsearch.service'
--- data/unity-scope-sshsearch.service 2013-01-28 01:50:41 +0000
+++ data/unity-scope-sshsearch.service 2013-03-18 17:57:23 +0000
@@ -1,3 +1,3 @@
1[D-BUS Service]1[D-BUS Service]
2Name=com.canonical.Unity.Scope.Connections.Sshsearch2Name=com.canonical.Unity.Scope.Connections.Sshsearch
3Exec=/usr/lib/ubuntu-scopes/sshsearch/unity_sshsearch_daemon.py3Exec=/usr/share/unity-scopes/sshsearch/unity_sshsearch_daemon.py
44
=== added directory 'debian'
=== added file 'debian/changelog'
--- debian/changelog 1970-01-01 00:00:00 +0000
+++ debian/changelog 2013-03-18 17:57:23 +0000
@@ -0,0 +1,10 @@
1unity-scope-sshsearch (0.1) UNRELEASED; urgency=low
2
3 [ Mark Tully ]
4 * Rename and port of unity-lens-sshsearch
5
6 [ Didier Roche ]
7 * Fix packaging
8 * Transition from unity-lens-sshsearch to this package
9
10 -- Mark Tully <markjtully@gmail.com> Mon, 18 Mar 2013 18:24:36 +0100
011
=== added file 'debian/compat'
--- debian/compat 1970-01-01 00:00:00 +0000
+++ debian/compat 2013-03-18 17:57:23 +0000
@@ -0,0 +1,1 @@
19
02
=== added file 'debian/control'
--- debian/control 1970-01-01 00:00:00 +0000
+++ debian/control 2013-03-18 17:57:23 +0000
@@ -0,0 +1,34 @@
1Source: unity-scope-sshsearch
2Section: gnome
3Priority: optional
4Maintainer: Mark Tully <markjtully@gmail.com>
5Build-Depends: debhelper (>= 9),
6 python,
7 python-distutils-extra,
8 python-gi,
9 pkg-config,
10 python-nose,
11 gir1.2-unity-5.0 (>= 6.91),
12 gir1.2-glib-2.0,
13 python-paramiko,
14Standards-Version: 3.9.4
15Homepage: https://launchpad.net/unity-scope-sshsearch
16# If you aren't a member of ~submarine but need to upload packaging changes,
17# just go ahead. ~submarine will notice and sync up the code again.
18Vcs-Bzr: https://code.launchpad.net/~submarine/unity-scope-sshsearch/trunk
19
20Package: unity-scope-sshsearch
21Architecture: all
22Depends: ${misc:Depends},
23 ${python:Depends},
24 python,
25 python-gi,
26 gir1.2-unity-5.0 (>= 6.91),
27 gir1.2-glib-2.0,
28 python-paramiko,
29Conflicts: unity-lens-sshsearch,
30Replaces: unity-lens-sshsearch,
31Provides: unity-lens-sshsearch,
32Description: ssh search scope for Unity
33 This package contains the "sshsearch" scope which allows Unity
34 to search for configured ssh connexions.
035
=== added file 'debian/copyright'
--- debian/copyright 1970-01-01 00:00:00 +0000
+++ debian/copyright 2013-03-18 17:57:23 +0000
@@ -0,0 +1,23 @@
1Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2Source: https://launchpad.net/unity-scope-sshsearch
3Upstream-Name: unity-scope-sshsearch
4Upstream-Contact: Mark Tully <markjtully@gmail.com>
5
6Files: *
7Copyright: 2012 Bernd Schlapsi
8 2013 Mark Tully
9License: GPL-3
10 This program is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation, version 3 of the License.
13 .
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 .
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 .
22 On Debian systems, the complete text of the GNU General
23 Public License version 3 can be found in '/usr/share/common-licenses/GPL-3'.
024
=== added file 'debian/rules'
--- debian/rules 1970-01-01 00:00:00 +0000
+++ debian/rules 2013-03-18 17:57:23 +0000
@@ -0,0 +1,18 @@
1#!/usr/bin/make -f
2# -*- makefile -*-
3
4
5%:
6 dh $@ --with python2
7
8override_dh_auto_clean:
9 python setup.py clean -a
10
11override_dh_auto_build:
12 python setup.py build
13
14override_dh_auto_test:
15 nosetests
16
17override_dh_auto_install:
18 python setup.py install --root=$(CURDIR)/debian/unity-scope-sshsearch --install-layout=deb
019
=== added directory 'debian/source'
=== added file 'debian/source/format'
--- debian/source/format 1970-01-01 00:00:00 +0000
+++ debian/source/format 2013-03-18 17:57:23 +0000
@@ -0,0 +1,1 @@
11.0
02
=== modified file 'po/unity-scope-sshsearch.pot'
--- po/unity-scope-sshsearch.pot 2013-01-29 07:41:51 +0000
+++ po/unity-scope-sshsearch.pot 2013-03-18 17:57:23 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2013-01-29 08:30+0100\n"11"POT-Creation-Date: 2013-03-18 18:23+0100\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,7 +18,7 @@
18"Content-Transfer-Encoding: 8bit\n"18"Content-Transfer-Encoding: 8bit\n"
1919
20#: ../src/unity_sshsearch_daemon.py:3420#: ../src/unity_sshsearch_daemon.py:34
21msgid "Categorytitle"21msgid "Boxes"
22msgstr ""22msgstr ""
2323
24#: ../src/unity_sshsearch_daemon.py:3624#: ../src/unity_sshsearch_daemon.py:36
@@ -30,7 +30,7 @@
30msgstr ""30msgstr ""
3131
32#: ../data/sshsearch.scope.in.h:132#: ../data/sshsearch.scope.in.h:1
33msgid "sshsearch;"33msgid "sshsearch;ssh;connections;"
34msgstr ""34msgstr ""
3535
36#: ../data/sshsearch.scope.in.h:236#: ../data/sshsearch.scope.in.h:2
3737
=== added file 'setup.cfg'
--- setup.cfg 1970-01-01 00:00:00 +0000
+++ setup.cfg 2013-03-18 17:57:23 +0000
@@ -0,0 +1,6 @@
1[build]
2i18n=True
3
4[build_i18n]
5domain=unity-scope-sshsearch
6desktop_files=[('share/unity/scopes/boxes', ('data/sshsearch.scope.in',))]
07
=== added file 'setup.py'
--- setup.py 1970-01-01 00:00:00 +0000
+++ setup.py 2013-03-18 17:57:23 +0000
@@ -0,0 +1,16 @@
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3from distutils.core import setup
4from DistUtilsExtra.command import *
5
6setup(name='unity-scope-sshsearch',
7 version='0.1',
8 author='Mark Tully',
9 author_email='markjtully@gmail.com',
10 url='http://launchpad.net/ubuntu-scopes',
11 license='GNU General Public License (GPL)',
12 data_files=[
13 ('share/dbus-1/services', ['data/unity-scope-sshsearch.service']),
14 ('share/unity-scopes/sshsearch', ['src/unity_sshsearch_daemon.py']),
15 ], cmdclass={'build': build_extra.build_extra,
16 'build_i18n': build_i18n.build_i18n,})
017
=== modified file 'src/unity_sshsearch_daemon.py'
--- src/unity_sshsearch_daemon.py 2013-01-28 01:50:41 +0000
+++ src/unity_sshsearch_daemon.py 2013-03-18 17:57:23 +0000
@@ -1,7 +1,8 @@
1#! /usr/bin/python1#! /usr/bin/python
2# -*- coding: utf-8 -*-2# -*- coding: utf-8 -*-
33
4# Copyright(C) 2012 name <email>4# Copyright(C) 2013 Mark Tully <markjtully@gmail.com>
5# Copyright(C) 2012 Bernd Schlapsi <brot@gmx.info>
5# This program is free software: you can redistribute it and/or modify it6# This program is free software: you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 3, as published7# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.8# by the Free Software Foundation.
@@ -26,12 +27,12 @@
26gettext.textdomain(APP_NAME)27gettext.textdomain(APP_NAME)
27_ = gettext.gettext28_ = gettext.gettext
2829
29BUS_NAME = 'com.canonical.Unity.Scope.Connections.Sshsearch'30BUS_NAME = 'com.canonical.Unity.Scope.Boxes.Sshsearch'
30BUS_PATH = '/com/canonical/unity/scope/connections/sshsearch'31BUS_PATH = '/com/canonical/unity/scope/boxes/sshsearch'
3132
32SVG_DIR = '/usr/share/icons/unity-icon-theme/places/svg/'33SVG_DIR = '/usr/share/icons/unity-icon-theme/places/svg/'
33CAT_0_ICON = Gio.ThemedIcon.new(SVG_DIR + 'group-connections.svg')34CAT_0_ICON = Gio.ThemedIcon.new(SVG_DIR + 'group-boxes.svg')
34CAT_0_TITLE = _('Categorytitle')35CAT_0_TITLE = _('Boxes')
3536
36NO_RESULTS_HINT = _('Sorry, there are no available SSH connections that match your search.')37NO_RESULTS_HINT = _('Sorry, there are no available SSH connections that match your search.')
37SEARCH_HINT = _('Search for available SSH connections')38SEARCH_HINT = _('Search for available SSH connections')
@@ -48,14 +49,14 @@
4849
49class Daemon:50class Daemon:
50 def __init__(self):51 def __init__(self):
51 self.scope = Unity.Scope.new(BUS_PATH, 'sshsearch')52 self.scope = Unity.DeprecatedScope.new(BUS_PATH, 'sshsearch')
52 self.scope.props.search_hint = SEARCH_HINT53 self.scope.props.search_hint = SEARCH_HINT
53 self.scope.search_in_global = True54 self.scope.search_in_global = True
54 cats = []55 cats = Unity.CategorySet.new()
55 cats.append(Unity.Category.new(CAT_0_TITLE.lower(),56 cats.add(Unity.Category.new(CAT_0_TITLE.lower(),
56 CAT_0_TITLE,57 CAT_0_TITLE,
57 CAT_0_ICON,58 CAT_0_ICON,
58 Unity.CategoryRenderer.VERTICAL_TILE))59 Unity.CategoryRenderer.VERTICAL_TILE))
59 self.scope.props.categories = cats60 self.scope.props.categories = cats
60 self.preferences = Unity.PreferencesManager.get_default()61 self.preferences = Unity.PreferencesManager.get_default()
61 self.preferences.connect('notify::remote-content-search', self._on_preference_changed)62 self.preferences.connect('notify::remote-content-search', self._on_preference_changed)
@@ -112,14 +113,14 @@
112 model = search.props.results_model113 model = search.props.results_model
113 model.clear()114 model.clear()
114 if self.preferences.props.remote_content_search != Unity.PreferencesManagerRemoteContent.ALL:115 if self.preferences.props.remote_content_search != Unity.PreferencesManagerRemoteContent.ALL:
115 search.finished()116 search.emit('finished')
116 return117 return
117 search_string = search.props.search_string.strip()118 search_string = search.props.search_string.strip()
118 print('Search changed to \'%s\'' % search_string)119 print('Search changed to \'%s\'' % search_string)
119 self.update_results_model(search_string, model)120 self.update_results_model(search_string, model)
120 search.set_reply_hint('no-results-hint',121 search.set_reply_hint('no-results-hint',
121 GLib.Variant.new_string(NO_RESULTS_HINT))122 GLib.Variant.new_string(NO_RESULTS_HINT))
122 search.finished()123 search.emit('finished')
123124
124 def update_results_model(self, search, results):125 def update_results_model(self, search, results):
125126

Subscribers

People subscribed via source and target branches

to all changes: