Merge lp:~townsend/libertine/launch-containerless-helpers into lp:libertine

Proposed by Christopher Townsend
Status: Merged
Approved by: Larry Price
Approved revision: 324
Merged at revision: 323
Proposed branch: lp:~townsend/libertine/launch-containerless-helpers
Merge into: lp:libertine
Diff against target: 145 lines (+53/-12)
6 files modified
debian/control (+1/-0)
python/libertine/Libertine.py (+26/-0)
python/libertine/__init__.py (+2/-0)
python/libertine/launcher/config.py (+13/-6)
tests/unit/test_launcher_with_dbus.py (+1/-1)
tools/libertine-launch (+10/-5)
To merge this branch: bzr merge lp:~townsend/libertine/launch-containerless-helpers
Reviewer Review Type Date Requested Status
Larry Price Approve
Libertine CI Bot continuous-integration Approve
Review via email: mp+309595@code.launchpad.net

Commit message

Add support for starting pasted and matchbox for snap based/containerless apps in U8.

To post a comment you must log in.
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:323
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/195/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/439
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=default/347
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/347
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=default/347
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=vivid+overlay,testname=default/347
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/347
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=yakkety,testname=default/347
    None: https://jenkins.canonical.com/libertine/job/lp-generic-update-mp/336/console
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/441
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=vivid+overlay/422
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=xenial+overlay/422
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=yakkety/422
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/421
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/421/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/421
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/421/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=yakkety/421
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=yakkety/421/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/421
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/421/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/421
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/421/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=yakkety/421
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=yakkety/421/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/195/rebuild

review: Approve (continuous-integration)
324. By Christopher Townsend

Add dependency on matchbox-window-manager in the libertine-xmir-tools package.

Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:324
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/196/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/440
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=default/348
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/348
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=default/348
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=vivid+overlay,testname=default/348
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/348
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=yakkety,testname=default/348
    None: https://jenkins.canonical.com/libertine/job/lp-generic-update-mp/337/console
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/442
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=vivid+overlay/423
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=xenial+overlay/423
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=yakkety/423
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/422
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/422/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/422
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/422/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=yakkety/422
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=yakkety/422/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/422
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/422/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/422
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/422/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=yakkety/422
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=yakkety/422/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/196/rebuild

review: Approve (continuous-integration)
Revision history for this message
Larry Price (larryprice) wrote :

lgtm! thanks for the quick update

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2016-10-27 15:44:44 +0000
3+++ debian/control 2016-10-28 18:53:32 +0000
4@@ -106,6 +106,7 @@
5 libqt5core5a,
6 libqt5gui5,
7 libqt5widgets5,
8+ matchbox-window-manager,
9 xmir,
10 ${misc:Depends},
11 ${python3:Depends},
12
13=== modified file 'python/libertine/Libertine.py'
14--- python/libertine/Libertine.py 2016-10-27 20:51:21 +0000
15+++ python/libertine/Libertine.py 2016-10-28 18:53:32 +0000
16@@ -48,6 +48,32 @@
17 return False
18
19
20+class NoContainer(object):
21+ """
22+ A containerless class used for launching apps with libertine-launch.
23+ """
24+ def connect(self):
25+ """
26+ A no-op function used by the Session class.
27+ """
28+ pass
29+
30+ def disconnect(self):
31+ """
32+ A no-op function used by the Session class.
33+ """
34+ pass
35+
36+ def start_application(self, app_exec_line, environ):
37+ import psutil
38+
39+ app = psutil.Popen(app_exec_line, env=environ)
40+ return app
41+
42+ def finish_application(self, app):
43+ app.wait()
44+
45+
46 class BaseContainer(metaclass=abc.ABCMeta):
47 """
48 An abstract base container to provide common functionality for all
49
50=== modified file 'python/libertine/__init__.py'
51--- python/libertine/__init__.py 2016-10-27 15:19:35 +0000
52+++ python/libertine/__init__.py 2016-10-28 18:53:32 +0000
53@@ -23,9 +23,11 @@
54 __all__ = [
55 # from Libertine
56 'LibertineContainer',
57+ 'NoContainer',
58 'utils',
59 ]
60
61 __docformat__ = "restructuredtext en"
62
63 from libertine.Libertine import LibertineContainer
64+from libertine.Libertine import NoContainer
65
66=== modified file 'python/libertine/launcher/config.py'
67--- python/libertine/launcher/config.py 2016-10-25 16:55:51 +0000
68+++ python/libertine/launcher/config.py 2016-10-28 18:53:32 +0000
69@@ -214,17 +214,24 @@
70 """Create a collection of pre-launch tasks."""
71 tasks = []
72 tasks.append(TaskConfig(TaskType.LAUNCH_SERVICE, ["pasted"]))
73+
74+ if self.container_id is None:
75+ tasks.append(TaskConfig(TaskType.LAUNCH_SERVICE, ['matchbox-window-manager', '-use_titlebar', 'no']))
76+
77 return tasks
78
79 def _create_socket_bridges(self):
80 """Create the required socket bridge configs."""
81 bridges = []
82- maliit_host_bridge = self._create_maliit_host_bridge()
83- if maliit_host_bridge:
84- bridges.append(maliit_host_bridge)
85- dbus_host_bridge = self._create_dbus_host_bridge()
86- if dbus_host_bridge:
87- bridges.append(dbus_host_bridge)
88+
89+ if self.container_id:
90+ maliit_host_bridge = self._create_maliit_host_bridge()
91+ if maliit_host_bridge:
92+ bridges.append(maliit_host_bridge)
93+ dbus_host_bridge = self._create_dbus_host_bridge()
94+ if dbus_host_bridge:
95+ bridges.append(dbus_host_bridge)
96+
97 return bridges
98
99 def _generate_session_socket_name(self, socket_target):
100
101=== modified file 'tests/unit/test_launcher_with_dbus.py'
102--- tests/unit/test_launcher_with_dbus.py 2016-08-28 00:17:54 +0000
103+++ tests/unit/test_launcher_with_dbus.py 2016-10-28 18:53:32 +0000
104@@ -75,7 +75,7 @@
105 super().setUp()
106 fake_maliit_host_address = 'unix:abstract=/tmp/maliit-host-socket'
107 self._dbus_server = self.useFixture(MockDBusServer(maliit_server_address=fake_maliit_host_address))
108- self._cli = [ self.getUniqueString(), self.getUniqueString() ]
109+ self._cli = [ '-i', self.getUniqueString(), self.getUniqueString() ]
110
111 def test_maliit_socket_bridge_from_dbus(self):
112 """
113
114=== modified file 'tools/libertine-launch'
115--- tools/libertine-launch 2016-10-26 13:58:19 +0000
116+++ tools/libertine-launch 2016-10-28 18:53:32 +0000
117@@ -18,18 +18,23 @@
118
119 import os
120
121-from libertine import launcher, LibertineContainer
122+from libertine import launcher
123
124 def main():
125 config = launcher.Config()
126
127 if config.container_id:
128+ from libertine import LibertineContainer
129+
130 container = LibertineContainer(container_id=config.container_id)
131- with launcher.Session(config, container) as session:
132- session.start_application()
133- session.run()
134 else:
135- os.execvp(config.exec_line[0], config.exec_line[0:])
136+ from libertine import NoContainer
137+
138+ container = NoContainer()
139+
140+ with launcher.Session(config, container) as session:
141+ session.start_application()
142+ session.run()
143
144 if __name__ == '__main__':
145 main()

Subscribers

People subscribed via source and target branches