[Debian-islamic-commits] [SCM] Packaging for Monajat branch, master, updated. debian/2.6.2-2-5-g1f4ea25

أحمد المحمو =?UTF-8?Q?=D8=AF=D9=8A=20?=(Ahmed El-Mahmoudy) aelmahmoudy at sabily.org
Sat Nov 26 21:58:20 UTC 2011


The following commit has been merged in the master branch:
commit 0376c78e7f2da99dbcefc8b7393d2521a1929b50
Author: أحمد المحمودي (Ahmed El-Mahmoudy) <aelmahmoudy at sabily.org>
Date:   Fri Nov 25 23:18:08 2011 +0200

    * Remove drop_cmp_to_key.diff as it is included in new upstream release.
    * Updated fix_locale.diff to set language after several trials

diff --git a/debian/patches/drop_cmp_to_key.diff b/debian/patches/drop_cmp_to_key.diff
deleted file mode 100644
index 258f34e..0000000
--- a/debian/patches/drop_cmp_to_key.diff
+++ /dev/null
@@ -1,17 +0,0 @@
-Description: Do not import cmp_to_key, it isn't supported by Python 2.6 and
- it's not used anyways
-Origin: http://git.ojuba.org/cgit/monajat/commit/?id=35c1f7658f8b3d84302e56b2f69690d110612a54
-Bug-Debian: http://bugs.debian.org/646441
-
-diff --git a/monajat/applet.py b/monajat/applet.py
-index 68ed03e..fd9d122 100644
---- a/monajat/applet.py
-+++ b/monajat/applet.py
-@@ -13,7 +13,6 @@ import cgi
- import math
- import json
- import time
--from functools  import cmp_to_key
- import gst
- 
- # in gnome3 ['actions', 'action-icons', 'body', 'body-markup', 'icon-static', 'persistence']
diff --git a/debian/patches/fix_locale.diff b/debian/patches/fix_locale.diff
index 16dca3f..6c08092 100644
--- a/debian/patches/fix_locale.diff
+++ b/debian/patches/fix_locale.diff
@@ -1,37 +1,52 @@
-Description: Simplify locale setting logic
- Removed logic that tries to guess the appropriate locale for the
- selected language, and leave that to setlocale. If successful, also the
- LC_MESSAGES environment variable is also set to that locale, otherwise
- just continue.
-Origin: http://git.ojuba.org/cgit/monajat/commit/?id=2772f74cd4ecf5a1f613ea8ad10855f960621693
-Bug-Debian: http://bugs.debian.org/646483
+Description: Set language after several trials
+Origin: http://git.ojuba.org/cgit/monajat/commit/?id=c013cce80553ef1b7749d7e1719f6a6862c84efb
+
+---
+ monajat/applet.py |   23 +++++++++++++++++++----
+ 1 files changed, 19 insertions(+), 4 deletions(-)
 
 diff --git a/monajat/applet.py b/monajat/applet.py
-index fd9d122..048d9f0 100644
+index bb5e750..211b4cb 100644
 --- a/monajat/applet.py
 +++ b/monajat/applet.py
-@@ -241,7 +241,6 @@ class ConfigDlg(gtk.Dialog):
+@@ -241,7 +241,25 @@ class ConfigDlg(gtk.Dialog):
      return gtk.Dialog.run(self, *a, **kw)
  
  class applet(object):
--  locale_re=re.compile('^[a-z]+_[A-Z]+$', re.I)
++  locale_re=re.compile('^[a-z]+_[A-Z]+$', re.I)
    skip_auto_fn=os.path.expanduser('~/.monajat-applet-skip-auto')
++  
++  def _init_locale(self, lang):
++    try: l=locale.setlocale(locale.LC_MESSAGES, (lang, 'UTF-8'))
++    except: pass
++    else:
++      if l: os.environ['LC_MESSAGES']=l
++      return
++    for l in locale.locale_alias.keys():
++      if not l.startswith(lang+'_') or not self.locale_re.match(l): continue
++      l,c=l.split('_',1)
++      l=l+"_"+c.upper()+".UTF-8"
++      try: locale.setlocale(locale.LC_MESSAGES, l)
++      except locale.Error: pass
++      else:
++          os.environ['LC_MESSAGES']=l
++          return
++
    def __init__(self):
      self.conf_dlg=None
-@@ -253,12 +252,10 @@ class applet(object):
+     self.chngbody=time.time()
+@@ -252,10 +270,7 @@ class applet(object):
      self.prayer_items=[]
      kw=self.conf_to_prayer_args()
      self.prayer=itl.PrayerTimes(**kw)
--    l=filter(lambda i: i.startswith(self.m.lang+'_') and self.locale_re.match(i), locale.locale_alias.keys())
--    if l:
--      l,c=l[0].split('_',1)
--      l=l+"_"+c.upper()+".UTF-8"
--      os.environ['LC_MESSAGES']=l
--      locale.setlocale(locale.LC_MESSAGES, l)
-+    try:
-+      l=locale.setlocale(locale.LC_MESSAGES, (self.m.lang, 'UTF-8'))
-+      if l: os.environ['LC_MESSAGES']=l
-+    except locale.Error: pass
+-    try:
+-      l=locale.setlocale(locale.LC_MESSAGES, (self.m.lang, 'UTF-8'))
+-      if l: os.environ['LC_MESSAGES']=l
+-    except locale.Error: pass
++    self._init_locale(self.m.lang)
      ld=os.path.join(self.m.get_prefix(),'..','locale')
      gettext.install('monajat', ld, unicode=0)
      self.ptnames=[_("Fajr"), _("Sunrise"), _("Dhuhr"), _("Asr"), _("Maghrib"), _("Isha'a")]
+-- 
+1.7.7.2
+
diff --git a/debian/patches/series b/debian/patches/series
index fb2cc4a..c0b7c51 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
-drop_cmp_to_key.diff
 fix_locale.diff

-- 
Packaging for Monajat



More information about the Debian-islamic-commits mailing list