Merge lp:~cyphermox/ubuntu-mono/secure-icons into lp:~ubuntu-art-pkg/ubuntu-mono/trunk

Proposed by Mathieu Trudel-Lapierre
Status: Merged
Merged at revision: 78
Proposed branch: lp:~cyphermox/ubuntu-mono/secure-icons
Merge into: lp:~ubuntu-art-pkg/ubuntu-mono/trunk
Diff against target: 156 lines (+121/-1)
5 files modified
debian/changelog (+10/-0)
debian/control (+2/-1)
debian/install (+1/-0)
debian/ubuntu-mono.postinst (+55/-0)
scavenge.py (+53/-0)
To merge this branch: bzr merge lp:~cyphermox/ubuntu-mono/secure-icons
Reviewer Review Type Date Requested Status
Paul Sladen (community) Approve
Review via email: mp+45268@code.launchpad.net

Description of the change

Add a script (written with the big help of Paul Sladen) to composite new icons at install time for nm-applet: those will be the icons used for VPN and secure wireless networks since they cannot be composited dynamically by nm-applet when using libappindicator.

To post a comment you must log in.
Revision history for this message
Paul Sladen (sladen) wrote :

I thinking was at package build time, rather than package postinst, but lets give it a whirl and see what happens, and need to sanity check what happens at package removal.

It's probably possible to simply down to something like:

  for icon in ubuntu-mono-{dark,light}/{22,24}/nm-signal-{00,25,50,75,100} ; do
      .../scavenge.py -o $(icon)-secure.svg $(icon).svg $(padlock).svg
  done

review: Approve
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Ack, very right, this is missing a prerm or postrm script to clean up the additional files.

I had understood from our discussion that you meant package postinst, not build time -- if we want to deal with build time simply it will increase the package's (deb) size slightly, but then we won't need to ship the scavenge script separately from a possible svgtools bundle. It's easy to just add the new files to the bzr branch directly.

In light of trying to avoid increasing size unnecessarily, I'd be for shipping "reusable parts" that can be composited to create the full set of icons, but I'm not sure how much this is scalable, feasible, etc. I think it can probably complicate things or at least the impact of simple changes across the icon set.

Revision history for this message
Paul Sladen (sladen) wrote :

Yes, I've fixed up debian/copyright, moved the script and added a prerm aswell as postinst handling for abort, but at the moment I'm experimenting with rewriting it as a Makefile so that they files are included in the package (don't worry, compression will nullify the increase) and on the LiveCD the files have already been postinsted anyway.

review: Needs Fixing
Revision history for this message
Paul Sladen (sladen) wrote :

Merged and sponsored with tweaks:

ubuntu-mono (0.0.24) natty; urgency=low

  * scavenge.py, debian/install: Add and install new scavenge.py script to
    patch multiple svg icons together.
  * ubuntu-mono.postinst: call scavenge.py to generate "secure" icons for
    nm-applet to use for VPNs and to denote wireless security.
  * debian/control: add a python Depends for the compositor script.

  [Paul Sladen]
  * debian/copyright: mention GPL-3+ for debian/scavenge.py
  * Makefile: replace postinst/prerm with Makefile

 -- Mathieu Trudel-Lapierre <email address hidden> Wed, 05 Jan 2011 09:15:31 -0500

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2010-11-15 12:37:21 +0000
+++ debian/changelog 2011-01-05 17:35:11 +0000
@@ -1,3 +1,13 @@
1ubuntu-mono (0.0.24) UNRELEASED; urgency=low
2
3 * scavenge.py, debian/install: Add and install new scavenge.py script to
4 patch multiple svg icons together.
5 * ubuntu-mono.postinst: call scavenge.py to generate "secure" icons for
6 nm-applet to use for VPNs and to denote wireless security.
7 * debian/control: add a python Depends for the compositor script.
8
9 -- Mathieu Trudel-Lapierre <mathieu-tl@ubuntu.com> Wed, 05 Jan 2011 09:15:31 -0500
10
1ubuntu-mono (0.0.23) natty; urgency=low11ubuntu-mono (0.0.23) natty; urgency=low
212
3 * debian/control: Add Vcs-Bzr.13 * debian/control: Add Vcs-Bzr.
414
=== modified file 'debian/control'
--- debian/control 2010-11-15 12:37:02 +0000
+++ debian/control 2011-01-05 17:35:11 +0000
@@ -13,7 +13,8 @@
13Depends: ${misc:Depends},13Depends: ${misc:Depends},
14 humanity-icon-theme,14 humanity-icon-theme,
15 gnome-icon-theme,15 gnome-icon-theme,
16 hicolor-icon-theme16 hicolor-icon-theme,
17 python
17Description: Ubuntu Mono Icon theme18Description: Ubuntu Mono Icon theme
18 Dark and Light panel icons to make your desktop beautiful19 Dark and Light panel icons to make your desktop beautiful
1920
2021
=== modified file 'debian/install'
--- debian/install 2010-03-04 11:27:44 +0000
+++ debian/install 2011-01-05 17:35:11 +0000
@@ -1,1 +1,2 @@
1ubuntu-mono-dark ubuntu-mono-light LoginIcons usr/share/icons1ubuntu-mono-dark ubuntu-mono-light LoginIcons usr/share/icons
2scavenge.py usr/share/ubuntu-mono/tools
23
=== added file 'debian/ubuntu-mono.postinst'
--- debian/ubuntu-mono.postinst 1970-01-01 00:00:00 +0000
+++ debian/ubuntu-mono.postinst 2011-01-05 17:35:11 +0000
@@ -0,0 +1,55 @@
1#!/bin/sh
2
3set -e
4
5compositor=/usr/share/ubuntu-mono/tools/scavenge.py
6
7case $1 in
8 configure)
9 # Post-process additional icons to composite.
10 for type in light dark; do
11 for iconsize in \
12 /usr/share/icons/ubuntu-mono-$type/status/22 \
13 /usr/share/icons/ubuntu-mono-$type/status/24 \
14 ;
15 do
16 $compositor -o $iconsize/nm-device-wired-secure.svg \
17 $iconsize/nm-device-wired.svg \
18 $iconsize/nm-vpn-lock.svg
19 $compositor -o $iconsize/nm-signal-00-secure.svg \
20 $iconsize/nm-signal-00.svg \
21 $iconsize/nm-vpn-lock.svg
22 $compositor -o $iconsize/nm-signal-25-secure.svg \
23 $iconsize/nm-signal-25.svg \
24 $iconsize/nm-vpn-lock.svg
25 $compositor -o $iconsize/nm-signal-50-secure.svg \
26 $iconsize/nm-signal-50.svg \
27 $iconsize/nm-vpn-lock.svg
28 $compositor -o $iconsize/nm-signal-75-secure.svg \
29 $iconsize/nm-signal-75.svg \
30 $iconsize/nm-vpn-lock.svg
31 $compositor -o $iconsize/nm-signal-100-secure.svg \
32 $iconsize/nm-signal-100.svg \
33 $iconsize/nm-vpn-lock.svg
34 $compositor -o $iconsize/gsm-3g-none-secure.svg \
35 $iconsize/gsm-3g-none.svg \
36 $iconsize/nm-vpn-lock.svg
37 $compositor -o $iconsize/gsm-3g-low-secure.svg \
38 $iconsize/gsm-3g-low.svg \
39 $iconsize/nm-vpn-lock.svg
40 $compositor -o $iconsize/gsm-3g-medium-secure.svg \
41 $iconsize/gsm-3g-medium.svg \
42 $iconsize/nm-vpn-lock.svg
43 $compositor -o $iconsize/gsm-3g-high-secure.svg \
44 $iconsize/gsm-3g-high.svg \
45 $iconsize/nm-vpn-lock.svg
46 $compositor -o $iconsize/gsm-3g-full-secure.svg \
47 $iconsize/gsm-3g-full.svg \
48 $iconsize/nm-vpn-lock.svg
49 done
50 update-icon-caches /usr/share/icons/ubuntu-mono-$type
51 done
52 ;;
53 *)
54 ;;
55esac
056
=== added file 'scavenge.py'
--- scavenge.py 1970-01-01 00:00:00 +0000
+++ scavenge.py 2011-01-05 17:35:11 +0000
@@ -0,0 +1,53 @@
1#!/usr/bin/env python
2# Copyright 2011 Canonical Ltd. Distributed under the terms of the GNU GPLv3 or later.
3# Combines multiple SVG files into a single SVG in batch mode
4# 2011-01-04 Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
5# 2011-01-05 Paul Sladen <sladen@canonica.com>
6
7import xml.dom.minidom
8import sys
9import optparse
10
11def commandline():
12 # Parse commandline
13 parser = optparse.OptionParser(usage = '%prog [options] INPUT.svg [MOREINPUT.svg] -o OUTPUT.svg')
14 parser.add_option("-n", "--dry-run", dest = "do_write",
15 default = True, action = "store_false",
16 help = "dry run: do not write output file, just test")
17 parser.add_option("-o", "--output", dest = "output",
18 help = "full output path for processed SVG file")
19 options, args = parser.parse_args()
20
21 # Validate
22 if len(args) < 1:
23 parser.error("one or more input SVG files required")
24 if options.do_write and not options.output:
25 parser.error("SVG output filename required")
26
27 return options, args
28
29def main():
30 options, args = commandline()
31
32 # Open first SVG and then composite others on top as overlays
33 base = xml.dom.minidom.parse(args[0])
34 newline = lambda: base.createTextNode('\n')
35
36 for overlay in args[1:]:
37 comment = base.createComment(" imported from '%s' " % overlay)
38 dom = xml.dom.minidom.parse(overlay)
39
40 # Pull-in '<svg>' tag, clear attributes and rename to '<g>'
41 g = base.importNode(dom.getElementsByTagName("svg")[0], deep = True)
42 [g.removeAttribute(k) for k in g.attributes.keys() if k != 'id']
43 g.tagName = 'g'
44
45 # Insert into first SVG with comments and spacing
46 for node in newline(), comment, newline(), g, newline():
47 base.documentElement.appendChild(node)
48
49 if options.do_write:
50 base.writexml(open(options.output, "w"))
51
52if __name__=='__main__':
53 main()

Subscribers

People subscribed via source and target branches