[Python-modules-commits] r23672 - in packages/pyxdg/trunk/debian (4 files)
mitya57-guest at users.alioth.debian.org
mitya57-guest at users.alioth.debian.org
Thu Mar 7 15:32:59 UTC 2013
Date: Thursday, March 7, 2013 @ 15:32:57
Author: mitya57-guest
Revision: 23672
Merge two patches from Ubuntu:
- gettext-support.patch: support Gettext-Domain headers;
- prefer-first-glob-for-finding-mimetype.patch: upstream patch
to fix tests failure.
Added:
packages/pyxdg/trunk/debian/patches/gettext-support.patch
packages/pyxdg/trunk/debian/patches/prefer-first-glob-for-finding-mimetype.patch
Modified:
packages/pyxdg/trunk/debian/changelog
packages/pyxdg/trunk/debian/patches/series
Modified: packages/pyxdg/trunk/debian/changelog
===================================================================
--- packages/pyxdg/trunk/debian/changelog 2013-03-07 15:20:10 UTC (rev 23671)
+++ packages/pyxdg/trunk/debian/changelog 2013-03-07 15:32:57 UTC (rev 23672)
@@ -1,4 +1,4 @@
-pyxdg (0.25-1ubuntu1) UNRELEASED; urgency=low
+pyxdg (0.25-2) UNRELEASED; urgency=low
* Team upload.
@@ -7,6 +7,13 @@
[ Dmitry Shachnev ]
* Unify patches naming (use .patch extension, and dashes in file name).
+ * Merge from Ubuntu:
+ + debian/patches/gettext-support.patch: support Gettext-Domain fields.
+ + debian/patches/prefer-first-glob-for-finding-mimetype.patch:
+ Cherry-pick from upstream to fix test failure with *.png files; when
+ there are multiple globs with the same pattern (as introduced in the
+ latest shared-mime-info update), the last one was preferred. It should
+ have been the first. [Thanks to Thomas Kluyver and Iain Lane]
-- Dmitry Shachnev <mitya57 at gmail.com> Thu, 07 Mar 2013 19:17:04 +0400
Added: packages/pyxdg/trunk/debian/patches/gettext-support.patch
===================================================================
--- packages/pyxdg/trunk/debian/patches/gettext-support.patch (rev 0)
+++ packages/pyxdg/trunk/debian/patches/gettext-support.patch 2013-03-07 15:32:57 UTC (rev 23672)
@@ -0,0 +1,50 @@
+Author: Michael Vogt <michael.vogt at ubuntu.com>
+Description: support Gettext-Domain fields
+ Support X-GNOME-Gettext-Domain and X-Ubuntu-Gettext-Domain fields
+ in .desktop files, for dynamic translation support.
+Last-Update: 2013-03-07
+
+--- a/xdg/IniFile.py
++++ b/xdg/IniFile.py
+@@ -8,6 +8,7 @@
+ debug)
+ import xdg.Locale
+ from xdg.util import u
++import gettext
+
+ def is_ascii(s):
+ """Return True if a string consists entirely of ASCII characters."""
+@@ -22,6 +23,7 @@
+ fileExtension = ''
+
+ filename = ''
++ gettext_domain = None
+
+ tainted = False
+
+@@ -101,6 +103,11 @@
+ else:
+ raise ParsingError("[%s]-Header missing" % headers[0], filename)
+
++ # check for gettext domain
++ e = self.content.get('Desktop Entry', {})
++ self.gettext_domain = e.get('X-GNOME-Gettext-Domain',
++ e.get('X-Ubuntu-Gettext-Domain', None))
++
+ # start stuff to access the keys
+ def get(self, key, group=None, locale=False, type="string", list=False):
+ # set default group
+@@ -110,7 +117,12 @@
+ # return key (with locale)
+ if (group in self.content) and (key in self.content[group]):
+ if locale:
+- value = self.content[group][self.__addLocale(key, group)]
++ key = self.__addLocale(key, group)
++ if key.endswith(']') or not self.gettext_domain:
++ # inline translations
++ value = self.content[group][key]
++ else:
++ value = gettext.dgettext(self.gettext_domain, self.content[group][key])
+ else:
+ value = self.content[group][key]
+ else:
Added: packages/pyxdg/trunk/debian/patches/prefer-first-glob-for-finding-mimetype.patch
===================================================================
--- packages/pyxdg/trunk/debian/patches/prefer-first-glob-for-finding-mimetype.patch (rev 0)
+++ packages/pyxdg/trunk/debian/patches/prefer-first-glob-for-finding-mimetype.patch 2013-03-07 15:32:57 UTC (rev 23672)
@@ -0,0 +1,16 @@
+Description: Prefer first glob (in shared-mime-info database) for finding mimetype, not last
+Author: Thomas Kluyver <takowl at gmail.com>
+Origin: upstream, commit:f87e662ed27edf88152dd6980120b2cf64890db9
+
+--- pyxdg-0.25.orig/xdg/Mime.py
++++ pyxdg-0.25/xdg/Mime.py
+@@ -360,7 +360,8 @@ def _cache_database():
+ if pattern.startswith('*.'):
+ rest = pattern[2:]
+ if not ('*' in rest or '[' in rest or '?' in rest):
+- exts[rest] = mtype
++ if rest not in exts:
++ exts[rest] = mtype
+ continue
+ if '*' in pattern or '[' in pattern or '?' in pattern:
+ globs.append((pattern, mtype))
Modified: packages/pyxdg/trunk/debian/patches/series
===================================================================
--- packages/pyxdg/trunk/debian/patches/series 2013-03-07 15:20:10 UTC (rev 23671)
+++ packages/pyxdg/trunk/debian/patches/series 2013-03-07 15:32:57 UTC (rev 23672)
@@ -1,2 +1,4 @@
fix-DesktopEntry-docstring.patch
set-default-menu.patch
+gettext-support.patch
+prefer-first-glob-for-finding-mimetype.patch
More information about the Python-modules-commits
mailing list