Merge lp:~timo-jyrinki/example-content/folder_i18n into lp:~ubuntu-core-dev/example-content/ubuntu

Proposed by Timo Jyrinki
Status: Merged
Merged at revision: not available
Proposed branch: lp:~timo-jyrinki/example-content/folder_i18n
Merge into: lp:~ubuntu-core-dev/example-content/ubuntu
Diff against target: None lines
To merge this branch: bzr merge lp:~timo-jyrinki/example-content/folder_i18n
Reviewer Review Type Date Requested Status
Ubuntu Core Development Team Pending
Review via email: mp+4416@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

The ~timo-jyrinki/example-content/folder_i18n branch changes the Examples link into an examples.desktop file, which is of type Link and points to the folder. It uses gettext to get translations on-the-fly from langpacks, therefore fixing the bug #45489 for the case of after-installation for every Ubuntu user's home folder. The link on the Live-CD desktop probably comes from elsewhere.

At the same time, some of the content was moved around. The python usage here is a bit of an overkill, but it was the way I (thought I) knew how to make this work. The only hack needed was for installing the .desktop file under /etc while still using cdbs defaults otherwise.

It's lintian clean and tested with pbuilder, and seems to work fine. I'm attaching a screenshot to the bug report of a situation where the examples.desktop is installed in /etc/skel (without translations), .mo files are in locale directories, a new user has been created and it has been logged in for the first time.

I didn't use Icon=Folder, since it's actually after the ordinary folders and the icon in my opinion confused the user. So it's just the default link icon, which I'd prefer over also a folder icon with a link arrow on it since it looks wrong in the alphabetical order if it looks like a folder but is after other folders in the list.

51. By Timo Jyrinki <timo@olohuone>

Remove postrm which I forgot. Not needed anymore.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'data'
=== added file 'data/examples.desktop.in'
--- data/examples.desktop.in 1970-01-01 00:00:00 +0000
+++ data/examples.desktop.in 2009-03-12 18:09:45 +0000
@@ -0,0 +1,8 @@
1[Desktop Entry]
2Version=1.0
3Type=Link
4_Name=Examples
5_Comment=Example content for Ubuntu
6URL=file:///usr/share/example-content/
7X-Ubuntu-Gettext-Domain=example-content
8
09
=== modified file 'debian/changelog'
--- debian/changelog 2008-10-22 07:16:03 +0000
+++ debian/changelog 2009-03-12 18:09:45 +0000
@@ -1,3 +1,13 @@
1example-content (36) jaunty; urgency=low
2
3 * Change symlink into a .desktop file
4 * Add I18N infrastructure for the .desktop file using Python (LP: #45489)
5 * Move content from root to main and source directories
6 * Update Standards-Version (no changes)
7 * Update copyright file
8
9 -- Timo Jyrinki <timo.jyrinki@iki.fi> Thu, 11 Mar 2009 19:56:55 +0200
10
1example-content (35) intrepid; urgency=low11example-content (35) intrepid; urgency=low
212
3 * fables_01_01_aesop.spx: re-encoded the file at the proper bitrate, smaller13 * fables_01_01_aesop.spx: re-encoded the file at the proper bitrate, smaller
414
=== modified file 'debian/control'
--- debian/control 2008-10-07 06:22:21 +0000
+++ debian/control 2009-03-12 18:09:45 +0000
@@ -2,14 +2,15 @@
2Section: x112Section: x11
3Priority: optional3Priority: optional
4Maintainer: Ubuntu Artwork Team <ubuntu-art@lists.ubuntu.com>4Maintainer: Ubuntu Artwork Team <ubuntu-art@lists.ubuntu.com>
5Build-Depends: cdbs, debhelper (>= 5), 5Build-Depends: cdbs, debhelper (>= 5), po-debconf, python-central, python-dev, python-setuptools, python-distutils-extra
6#Build-Depends-Indep: openoffice.org-dev, xvfb, xfonts-base6#Build-Depends-Indep: openoffice.org-dev, xvfb, xfonts-base
7XS-Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-art-pkg/example-content/ubuntu7XS-Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-art-pkg/example-content/ubuntu
8Standards-Version: 3.7.38Standards-Version: 3.8.0
9Homepage: https://launchpad.net/example-content9Homepage: https://launchpad.net/example-content
1010
11Package: example-content11Package: example-content
12Architecture: all12Architecture: all
13Depends: ${misc:Depends}
13Description: Ubuntu example content14Description: Ubuntu example content
14 For each desktop application in the default install where it is practical, 15 For each desktop application in the default install where it is practical,
15 we provide at least one piece of example content. This is valuable for 16 we provide at least one piece of example content. This is valuable for
1617
=== modified file 'debian/copyright'
--- debian/copyright 2006-09-07 15:31:30 +0000
+++ debian/copyright 2009-03-12 18:09:45 +0000
@@ -60,6 +60,12 @@
60Henrik Nilsen Omma <henrik@ubuntu.com>60Henrik Nilsen Omma <henrik@ubuntu.com>
6161
6262
63Python I18N framework:
64Based loosely on checkbox package's framework by Marc Tardif
65<marc.tardif@canonical.com>, modified for example-content usage
66by Timo Jyrinki <timo.jyrinki@iki.fi>. Licensed under GPL.
67
68
6369
64License:70License:
6571
6672
=== modified file 'debian/install'
--- debian/install 2008-10-16 09:58:27 +0000
+++ debian/install 2009-03-12 18:09:45 +0000
@@ -1,4 +1,1 @@
1*.{doc,odg,odp,ods,odt,ogg,png,rtf,spx,TXT,xcf,xls,pdf,jpg} /usr/share/example-content1etc/skel/examples.desktop /etc/skel
2#build/usr/lib/openoffice /usr/lib
3logos /usr/share/example-content
4Ubuntu_Free_Culture_Showcase /usr/share/example-content
52
=== removed file 'debian/links'
--- debian/links 2006-03-23 13:56:32 +0000
+++ debian/links 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1/usr/share/example-content /etc/skel/Examples
20
=== modified file 'debian/rules'
--- debian/rules 2008-10-07 06:22:21 +0000
+++ debian/rules 2009-03-12 18:09:45 +0000
@@ -1,5 +1,15 @@
1#!/usr/bin/make -f1#!/usr/bin/make -f
2
3DEB_PYTHON_SYSTEM := pycentral
4
2include /usr/share/cdbs/1/rules/debhelper.mk5include /usr/share/cdbs/1/rules/debhelper.mk
6include /usr/share/cdbs/1/class/python-distutils.mk
7
8# DEB_PYTHON_INSTALL_ARGS_ALL := --no-compile
9# --single-version-externally-managed
10
11clean::
12 rm -rf build etc example_content.egg-info debian/pycompat
313
4# oversized .svg files14# oversized .svg files
5OVERSIZED_FILES :=15OVERSIZED_FILES :=
616
=== added directory 'main'
=== renamed file 'case_Contact.pdf' => 'main/case_Contact.pdf'
=== renamed file 'case_KRUU.pdf' => 'main/case_KRUU.pdf'
=== renamed file 'case_OaklandUniversity.pdf' => 'main/case_OaklandUniversity.pdf'
=== renamed file 'case_Skegness.pdf' => 'main/case_Skegness.pdf'
=== renamed file 'case_Wellcome.pdf' => 'main/case_Wellcome.pdf'
=== renamed file 'case_howard_county_library.pdf' => 'main/case_howard_county_library.pdf'
=== renamed file 'case_oxford_archaeology.pdf' => 'main/case_oxford_archaeology.pdf'
=== renamed file 'case_ubuntu_johnshopkins_v2.pdf' => 'main/case_ubuntu_johnshopkins_v2.pdf'
=== renamed file 'case_ubuntu_locatrix_v1.pdf' => 'main/case_ubuntu_locatrix_v1.pdf'
=== renamed file 'fables_01_01_aesop.spx' => 'main/fables_01_01_aesop.spx'
=== renamed file 'gimp-ubuntu-splash.xcf' => 'main/gimp-ubuntu-splash.xcf'
=== renamed file 'kubuntu-leaflet.jpg' => 'main/kubuntu-leaflet.jpg'
=== renamed file 'oo-about-these-files.odt' => 'main/oo-about-these-files.odt'
=== renamed file 'oo-about-ubuntu-ru.rtf' => 'main/oo-about-ubuntu-ru.rtf'
=== renamed file 'oo-derivatives.doc' => 'main/oo-derivatives.doc'
=== renamed file 'oo-maxwell.odt' => 'main/oo-maxwell.odt'
=== renamed file 'oo-payment-schedule.ods' => 'main/oo-payment-schedule.ods'
=== renamed file 'oo-presenting-kubuntu.odp' => 'main/oo-presenting-kubuntu.odp'
=== renamed file 'oo-presenting-ubuntu.odp' => 'main/oo-presenting-ubuntu.odp'
=== renamed file 'oo-trig.xls' => 'main/oo-trig.xls'
=== renamed file 'oo-welcome.odt' => 'main/oo-welcome.odt'
=== added directory 'po'
=== added file 'po/POTFILES.in'
--- po/POTFILES.in 1970-01-01 00:00:00 +0000
+++ po/POTFILES.in 2009-03-12 18:09:45 +0000
@@ -0,0 +1,6 @@
1# List of source files containing translatable strings.
2# Please keep this file sorted alphabetically.
3#
4[encoding: UTF-8]
5data/examples.desktop.in
6
07
=== added file 'po/es.po'
--- po/es.po 1970-01-01 00:00:00 +0000
+++ po/es.po 2009-03-12 18:09:45 +0000
@@ -0,0 +1,25 @@
1# SOME DESCRIPTIVE TITLE.
2# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3# This file is distributed under the same license as the PACKAGE package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5#
6#, fuzzy
7msgid ""
8msgstr ""
9"Project-Id-Version: example-content\n"
10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2009-03-11 11:36+0200\n"
12"PO-Revision-Date: 2009-03-11 11:39+0200\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
15"MIME-Version: 1.0\n"
16"Content-Type: text/plain; charset=UTF-8\n"
17"Content-Transfer-Encoding: 8bit\n"
18
19#: ../data/examples.desktop.in.h:1
20msgid "Example content for Ubuntu"
21msgstr "Contenido del ejemplo para Ubuntu"
22
23#: ../data/examples.desktop.in.h:2
24msgid "Examples"
25msgstr "Ejemplos"
026
=== added file 'po/example-content.pot'
--- po/example-content.pot 1970-01-01 00:00:00 +0000
+++ po/example-content.pot 2009-03-12 18:09:45 +0000
@@ -0,0 +1,25 @@
1# SOME DESCRIPTIVE TITLE.
2# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3# This file is distributed under the same license as the PACKAGE package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5#
6#, fuzzy
7msgid ""
8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2009-03-12 17:04+0200\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
15"MIME-Version: 1.0\n"
16"Content-Type: text/plain; charset=CHARSET\n"
17"Content-Transfer-Encoding: 8bit\n"
18
19#: ../data/examples.desktop.in.h:1
20msgid "Example content for Ubuntu"
21msgstr ""
22
23#: ../data/examples.desktop.in.h:2
24msgid "Examples"
25msgstr ""
026
=== added file 'po/fi.po'
--- po/fi.po 1970-01-01 00:00:00 +0000
+++ po/fi.po 2009-03-12 18:09:45 +0000
@@ -0,0 +1,25 @@
1# SOME DESCRIPTIVE TITLE.
2# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3# This file is distributed under the same license as the PACKAGE package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5#
6#, fuzzy
7msgid ""
8msgstr ""
9"Project-Id-Version: example-content\n"
10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2009-03-11 11:36+0200\n"
12"PO-Revision-Date: 2009-03-11 11:39+0200\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
15"MIME-Version: 1.0\n"
16"Content-Type: text/plain; charset=UTF-8\n"
17"Content-Transfer-Encoding: 8bit\n"
18
19#: ../data/examples.desktop.in.h:1
20msgid "Example content for Ubuntu"
21msgstr "Esimerkkisisältöjä Ubuntulle"
22
23#: ../data/examples.desktop.in.h:2
24msgid "Examples"
25msgstr "Esimerkkejä"
026
=== added file 'po/fr.po'
--- po/fr.po 1970-01-01 00:00:00 +0000
+++ po/fr.po 2009-03-12 18:09:45 +0000
@@ -0,0 +1,25 @@
1# SOME DESCRIPTIVE TITLE.
2# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3# This file is distributed under the same license as the PACKAGE package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5#
6#, fuzzy
7msgid ""
8msgstr ""
9"Project-Id-Version: example-content\n"
10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2009-03-11 11:36+0200\n"
12"PO-Revision-Date: 2009-03-11 11:39+0200\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
15"MIME-Version: 1.0\n"
16"Content-Type: text/plain; charset=UTF-8\n"
17"Content-Transfer-Encoding: 8bit\n"
18
19#: ../data/examples.desktop.in.h:1
20msgid "Example content for Ubuntu"
21msgstr "Contenu d'exemple pour Ubuntu"
22
23#: ../data/examples.desktop.in.h:2
24msgid "Examples"
25msgstr "Exemples"
026
=== added file 'setup.cfg'
--- setup.cfg 1970-01-01 00:00:00 +0000
+++ setup.cfg 2009-03-12 18:09:45 +0000
@@ -0,0 +1,11 @@
1[build]
2i18n=True
3
4[build_i18n]
5domain=example-content
6# This is ugly, but needed so that it gets installed in the correct place
7desktop_files=[("../etc/skel/", ("data/examples.desktop.in",))]
8
9[install_egg_info]
10# just away from the packaging directory
11install_dir = build/temp
012
=== added file 'setup.py'
--- setup.py 1970-01-01 00:00:00 +0000
+++ setup.py 2009-03-12 18:09:45 +0000
@@ -0,0 +1,70 @@
1#!/usr/bin/env python
2
3import os
4import re
5import posixpath
6from glob import glob
7
8from distutils.core import setup
9from setuptools import setup
10
11from distutils.command.install_data import install_data
12#from DistUtilsExtra.command.build_extra import build_extra
13from DistUtilsExtra.command.build_i18n import build_i18n
14
15def changelog_version(changelog="debian/changelog"):
16 version = "dev"
17 if posixpath.exists(changelog):
18 head=open(changelog).readline()
19 match = re.compile(".*\((.*)\).*").match(head)
20 if match:
21 version = match.group(1)
22
23 return version
24
25class example_content_install_data(install_data, object):
26
27 def finalize_options(self):
28 """Add wildcard support for filenames."""
29 super(example_content_install_data, self).finalize_options()
30
31 for f in self.data_files:
32 if type(f) != str:
33 files = f[1]
34 i = 0
35 while i < len(files):
36 if "*" in files[i]:
37 for e in glob(files[i]):
38 files.append(e)
39 files.pop(i)
40 i -= 1
41 i += 1
42
43 def run(self):
44 """Run substitutions on files."""
45 super(example_content_install_data, self).run()
46 # Causes Lintian warning
47 ## os.chmod("etc/skel/examples.desktop", 755)
48 return
49
50setup(
51 name = "example-content",
52 version = changelog_version(),
53 author = "Timo Jyrinki",
54 author_email = "timo.jyrinki@iki.fi",
55 license = "GPL",
56 description = "Example Content I18N",
57 long_description = """
58Python is only used for I18N of the .desktop entry.
59""",
60 data_files = [
61 ("share/example-content/", ["main/*"]),
62 ("share/example-content/logos/", ["logos/*"]),
63 ("share/example-content/Ubuntu_Free_Culture_Showcase/", ["Ubuntu_Free_Culture_Showcase/*"])
64 ],
65 cmdclass = {
66 "install_data": example_content_install_data,
67# "build" : build_extra,
68 "build_i18n" : build_i18n }
69)
70
071
=== added directory 'source'
=== renamed file 'kubuntu-leaflet.svg' => 'source/kubuntu-leaflet.svg'

Subscribers

People subscribed via source and target branches

to all changes: