Merge lp:~chipaca/ubuntu-system-settings/push-helper into lp:ubuntu-system-settings

Proposed by John Lenton
Status: Merged
Approved by: Iain Lane
Approved revision: 826
Merged at revision: 883
Proposed branch: lp:~chipaca/ubuntu-system-settings/push-helper
Merge into: lp:ubuntu-system-settings
Diff against target: 202 lines (+113/-4)
6 files modified
CMakeLists.txt (+2/-0)
debian/control (+4/-1)
debian/ubuntu-system-settings.install (+1/-0)
po/CMakeLists.txt (+15/-1)
push-helper/software-updates-helper.py (+89/-0)
tests/test_code.py.in (+2/-2)
To merge this branch: bzr merge lp:~chipaca/ubuntu-system-settings/push-helper
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Iain Lane Approve
Review via email: mp+229571@code.launchpad.net

Commit message

Bring the system settings push helper over from ubuntu-push.

Description of the change

Bring the system settings push helper over from ubuntu-push.

To post a comment you must log in.
820. By John Lenton

expanded the comments a bit

Revision history for this message
Iain Lane (laney) wrote :

Inline.

review: Needs Fixing
Revision history for this message
Iain Lane (laney) :
Revision history for this message
Iain Lane (laney) :
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:819
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1142/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3020
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2396
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/334
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/334
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/334/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/334
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3067
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4263
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4263/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10978
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1984
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2663
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2663/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/1142/rebuild

review: Needs Fixing (continuous-integration)
821. By John Lenton

not Conflicts, but Breaks and Replaces.

822. By John Lenton

move helper into its own dir, include in pyflakes and pep8, modify helper to pass pyflakes and pep8

823. By John Lenton

use cmake to install the helper, not debian/rules.

824. By John Lenton

add a pot-py target to po/

825. By John Lenton

get rid of now spurious define in rules

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:820
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1144/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3022
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2398/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/336
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/336
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/336/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/336
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3068
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4265
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4265/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10981
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1985/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2665
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2665/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/1144/rebuild

review: Needs Fixing (continuous-integration)
826. By John Lenton

merged trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:825
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1148/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3028
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2403
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/340
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/340
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/340/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/340
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3074
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4271
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4271/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10992
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1989
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2670
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2670/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/1148/rebuild

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

FAILED: Continuous integration, rev:826
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1150/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3036
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2410/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/342
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/342
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/342/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/342
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3079
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4279
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4279/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11002
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1994/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2677
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2677/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/1150/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Iain Lane (laney) wrote :

Looks nice now, thanks

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

FAILED: Continuous integration, rev:826
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1201/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3345
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2617
    FAILURE: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/394/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/390
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/390/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/393
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3281
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4591
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4591/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11276
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2120
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2891
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2891/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/1201/rebuild

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-07-31 13:43:09 +0000
+++ CMakeLists.txt 2014-08-05 11:50:55 +0000
@@ -58,6 +58,7 @@
58set(PLUGIN_QML_DIR "${CMAKE_INSTALL_PREFIX}/${PLUGIN_QML_DIR_BASE}")58set(PLUGIN_QML_DIR "${CMAKE_INSTALL_PREFIX}/${PLUGIN_QML_DIR_BASE}")
59set(PLUGIN_PRIVATE_MODULE_DIR "${CMAKE_INSTALL_PREFIX}/${LIBDIR}/${PLUGIN_PRIVATE_MODULE_DIR_BASE}")59set(PLUGIN_PRIVATE_MODULE_DIR "${CMAKE_INSTALL_PREFIX}/${LIBDIR}/${PLUGIN_PRIVATE_MODULE_DIR_BASE}")
60set(SETTINGS_SHARE_DIR "${CMAKE_INSTALL_PREFIX}/${PLUGIN_MANIFEST_DIR_BASE}")60set(SETTINGS_SHARE_DIR "${CMAKE_INSTALL_PREFIX}/${PLUGIN_MANIFEST_DIR_BASE}")
61set(PUSH_HELPER_DIR "lib/ubuntu-push-client/legacy-helpers")
6162
62SET(CMAKE_INSTALL_RPATH "${PLUGIN_MODULE_DIR}")63SET(CMAKE_INSTALL_RPATH "${PLUGIN_MODULE_DIR}")
6364
@@ -75,6 +76,7 @@
75install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ubuntu-system-settings.desktop DESTINATION share/applications)76install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ubuntu-system-settings.desktop DESTINATION share/applications)
76install(FILES ubuntu-system-settings.url-dispatcher DESTINATION share/url-dispatcher/urls)77install(FILES ubuntu-system-settings.url-dispatcher DESTINATION share/url-dispatcher/urls)
77install(FILES screenshot.png DESTINATION ${SETTINGS_SHARE_DIR})78install(FILES screenshot.png DESTINATION ${SETTINGS_SHARE_DIR})
79install(PROGRAMS push-helper/software-updates-helper.py DESTINATION ${PUSH_HELPER_DIR} RENAME ubuntu-system-settings)
7880
79if(cmake_build_type_lower MATCHES coverage)81if(cmake_build_type_lower MATCHES coverage)
80 ENABLE_COVERAGE_REPORT(TARGETS system-settings FILTER /usr/include ${CMAKE_SOURCE_DIR}/tests/* ${CMAKE_BINARY_DIR}/*)82 ENABLE_COVERAGE_REPORT(TARGETS system-settings FILTER /usr/include ${CMAKE_SOURCE_DIR}/tests/* ${CMAKE_BINARY_DIR}/*)
8183
=== modified file 'debian/control'
--- debian/control 2014-08-01 17:10:25 +0000
+++ debian/control 2014-08-05 11:50:55 +0000
@@ -72,7 +72,7 @@
72 click,72 click,
73 ubuntu-keyboard-data (>= 0.99.trunk.phablet2+13.10.20131001),73 ubuntu-keyboard-data (>= 0.99.trunk.phablet2+13.10.20131001),
74 urfkill,74 urfkill,
75# for the session-migration script75# for the session-migration script (python3 itself also for the push helper)
76 python3,76 python3,
77 python3-gi,77 python3-gi,
78 python3-dbus,78 python3-dbus,
@@ -81,6 +81,9 @@
81 ubuntu-system-settings-online-accounts,81 ubuntu-system-settings-online-accounts,
82 ubuntu-touch-sounds,82 ubuntu-touch-sounds,
83Conflicts: ubuntu-system-settings-example83Conflicts: ubuntu-system-settings-example
84# ubuntu-push-client shipped the system settings push helper until 0.60:
85Breaks: ubuntu-push-client (<<0.61),
86Replaces: ubuntu-push-client (<<0.61),
84Description: System Settings application for Ubuntu Touch87Description: System Settings application for Ubuntu Touch
85 This package contains the System Settings application used on the88 This package contains the System Settings application used on the
86 Ubuntu Touch images, it's designed for phones, tablets and convergent89 Ubuntu Touch images, it's designed for phones, tablets and convergent
8790
=== modified file 'debian/ubuntu-system-settings.install'
--- debian/ubuntu-system-settings.install 2014-07-17 16:25:10 +0000
+++ debian/ubuntu-system-settings.install 2014-08-05 11:50:55 +0000
@@ -5,3 +5,4 @@
5usr/share/locale5usr/share/locale
6usr/share/ubuntu/settings/system6usr/share/ubuntu/settings/system
7usr/share/url-dispatcher7usr/share/url-dispatcher
8usr/lib/ubuntu-push-client/legacy-helpers
89
=== modified file 'po/CMakeLists.txt'
--- po/CMakeLists.txt 2013-12-31 19:30:03 +0000
+++ po/CMakeLists.txt 2014-08-05 11:50:55 +0000
@@ -6,6 +6,8 @@
6 "${CMAKE_SOURCE_DIR}/wizard/qml/*/*.qml")6 "${CMAKE_SOURCE_DIR}/wizard/qml/*/*.qml")
7file(GLOB SETTINGSFILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"7file(GLOB SETTINGSFILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
8 "${CMAKE_SOURCE_DIR}/plugins/*/*.settings")8 "${CMAKE_SOURCE_DIR}/plugins/*/*.settings")
9file(GLOB PYFILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
10 "${CMAKE_SOURCE_DIR}/push-helper/*.py")
911
10add_custom_command(OUTPUT settings.js12add_custom_command(OUTPUT settings.js
11 COMMAND ./extractsettingsinfo ${SETTINGSFILES} -o ${CMAKE_CURRENT_BINARY_DIR}/settings.js13 COMMAND ./extractsettingsinfo ${SETTINGSFILES} -o ${CMAKE_CURRENT_BINARY_DIR}/settings.js
@@ -41,7 +43,19 @@
41 DEPENDS pot-qml ${CPPFILES}43 DEPENDS pot-qml ${CPPFILES}
42)44)
4345
44add_custom_target(pot DEPENDS pot-qml pot-cpp)46add_custom_target(pot-py
47 COMMAND ${XGETTEXT_BIN} -o ubuntu-system-settings.pot
48 --join-existing
49 --copyright=\"Canonical Ltd.\"
50 --package-name ubuntu-system-settings
51 --add-comments=TRANSLATORS
52 --keyword=_
53 ${PYFILES}
54 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
55 DEPENDS ${PYFILES}
56)
57
58add_custom_target(pot DEPENDS pot-qml pot-cpp pot-py)
4559
46set(languages "ar;ast;be;bg;bs;ca;cs;de;el;en_AU;en_GB;eo;es;fa;fi;fr;gl;gu;he;hi;hr;hu;id;it;km;ko;lo;lv;ms;my;nb;pl;pt_BR;pt;ru;shn;sl;sv;tr;ug;uk;xh;zh_CN;zh_HK;zh_TW")60set(languages "ar;ast;be;bg;bs;ca;cs;de;el;en_AU;en_GB;eo;es;fa;fi;fr;gl;gu;he;hi;hr;hu;id;it;km;ko;lo;lv;ms;my;nb;pl;pt_BR;pt;ru;shn;sl;sv;tr;ug;uk;xh;zh_CN;zh_HK;zh_TW")
47foreach(i ${languages})61foreach(i ${languages})
4862
=== added directory 'push-helper'
=== added file 'push-helper/software-updates-helper.py'
--- push-helper/software-updates-helper.py 1970-01-01 00:00:00 +0000
+++ push-helper/software-updates-helper.py 2014-08-05 11:50:55 +0000
@@ -0,0 +1,89 @@
1#!/usr/bin/python3
2# -*- coding: utf-8 -*-
3#
4# Software Updates Push Notifications helper.
5#
6# This helper is called with one of three things:
7# a) regular push messages about updated click packages¹
8# b) broadcast messages about system updates
9# c) notifications you send yourself over dbus to actually notify the user that
10# an update is ready to install².
11#
12# Figuring out which of those is the case is also this helper's job.
13#
14# notes:
15# 1. nobody is sending those at the time of writing.
16# 2. yes, this is rather convoluted. Most push helpers don't have to deal with
17# this stuff.
18
19import json
20import sys
21import time
22import gettext
23
24if len(sys.argv) != 3:
25 print("File in and out expected via argv", file=sys.stderr)
26 sys.exit(1)
27
28f1, f2 = sys.argv[1:3]
29_ = gettext.translation("ubuntu-system-settings").gettext
30
31# here you should look at the input (the contents of the file whose
32# name is in f1, which are guaranteed to be json). If it's a broadcast
33# it will be the most recent we've received, and will have passed a
34# minimum amount of sanity checking, but you can probably do more. As
35# per the design on https://wiki.ubuntu.com/SoftwareUpdates#Prompting
36# if things are set to auto-download you should go download them (in a
37# child process -- this helper process itself has 4 more seconds to
38# live).
39#
40# the broadcast payload will be a single json object looking like
41# { image-channel/device-model": [build-number, channel-alias]}
42#
43# e.g.,
44#
45# {"ubuntu-touch/utopic-proposed/hammerhead":[265,""]}
46#
47#
48# When the click server starts sending notifications of packages a user can
49# update, you should probably describe that payload here. What to do with it
50# is described in some detail in the wiki page above.
51#
52#
53# Once you've downloaded things and need to actually notify the user, you'd
54# send a notification as below, over dbus to Post. That's the third payload
55# this script will be called with; for that case you'd just pass the payload
56# through.
57#
58# For cases when you don't want to notify the user (yet), the correct
59# output (to be written to a file whose name is f2) is “{}”, i.e. an
60# empty json object.
61#
62# For now, this script assumes everything that comes in is a valid
63# broadcast notification, and notifies the user directly:
64
65
66icon = "/usr/share/ubuntu/settings/system/icons/settings-system-update.svg"
67obj = {
68 "notification": {
69 "emblem-counter": {
70 "count": 1,
71 "visible": True,
72 },
73 "vibrate": {
74 "pattern": [50, 150],
75 "repeat": 3,
76 },
77 "card": {
78 "summary": _("There's an updated system image."),
79 "body": _("Tap to open the system updater."),
80 "actions": ["settings:///system/system-update"],
81 "icon": icon,
82 "timestamp": int(time.time()),
83 "persist": True,
84 "popup": True,
85 },
86 },
87}
88
89json.dump(obj, open(f2, "w"))
090
=== modified file 'tests/test_code.py.in'
--- tests/test_code.py.in 2014-07-17 17:03:17 +0000
+++ tests/test_code.py.in 2014-08-05 11:50:55 +0000
@@ -23,7 +23,7 @@
23 )23 )
24 def test_pyflakes(self):24 def test_pyflakes(self):
25 pyflakes = subprocess.Popen(25 pyflakes = subprocess.Popen(
26 ['pyflakes3', '@CMAKE_CURRENT_SOURCE_DIR@'],26 ['pyflakes3', '@CMAKE_CURRENT_SOURCE_DIR@', '@CMAKE_CURRENT_SOURCE_DIR@/../push-helper/'],
27 stdout=subprocess.PIPE, universal_newlines=True27 stdout=subprocess.PIPE, universal_newlines=True
28 )28 )
29 (out, err) = pyflakes.communicate()29 (out, err) = pyflakes.communicate()
@@ -34,7 +34,7 @@
34 )34 )
35 def test_pep8(self):35 def test_pep8(self):
36 pep8 = subprocess.Popen(36 pep8 = subprocess.Popen(
37 ['pep8', '@CMAKE_CURRENT_SOURCE_DIR@'],37 ['pep8', '@CMAKE_CURRENT_SOURCE_DIR@', '@CMAKE_CURRENT_SOURCE_DIR@/../push-helper/'],
38 stdout=subprocess.PIPE, universal_newlines=True38 stdout=subprocess.PIPE, universal_newlines=True
39 )39 )
40 (out, err) = pep8.communicate()40 (out, err) = pep8.communicate()

Subscribers

People subscribed via source and target branches