~mterry/ubuntu-system-settings/wizard-introspection-rtm

« back to all changes in this revision

Viewing changes to push-helper/software-updates-helper.py

  • Committer: John R. Lenton
  • Date: 2014-08-05 09:32:39 UTC
  • mto: This revision was merged to the branch mainline in revision 883.
  • Revision ID: jlenton@gmail.com-20140805093239-wdep2h3poc6803ul
move helper into its own dir, include in pyflakes and pep8, modify helper to pass pyflakes and pep8

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    sys.exit(1)
25
25
 
26
26
f1, f2 = sys.argv[1:3]
27
 
gettext.install("ubuntu-system-settings")
 
27
_ = gettext.translation("ubuntu-system-settings").gettext
28
28
 
29
29
# here you should look at the input (the contents of the file whose
30
30
# name is in f1, which are guaranteed to be json). If it's a broadcast
61
61
# broadcast notification, and notifies the user directly:
62
62
 
63
63
 
 
64
icon = "/usr/share/ubuntu/settings/system/icons/settings-system-update.svg"
64
65
obj = {
65
66
    "notification": {
66
67
        "emblem-counter": {
68
69
            "visible": True,
69
70
        },
70
71
        "vibrate": {
71
 
            "pattern": [50,150],
 
72
            "pattern": [50, 150],
72
73
            "repeat": 3,
73
74
        },
74
75
        "card": {
75
76
            "summary": _("There's an updated system image."),
76
77
            "body": _("Tap to open the system updater."),
77
78
            "actions": ["settings:///system/system-update"],
78
 
            "icon": "/usr/share/ubuntu/settings/system/icons/settings-system-update.svg",
 
79
            "icon": icon,
79
80
            "timestamp": int(time.time()),
80
81
            "persist": True,
81
82
            "popup": True,
83
84
    },
84
85
}
85
86
 
86
 
json.dump(obj, open(f2,"w"))
 
87
json.dump(obj, open(f2, "w"))