[pybliographer/wip/gtk3] scripts: Fix regression when using plurals on pybliocheck



commit 4202149c7b475bdf6454449f5193f786bd133583
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Tue Oct 10 22:46:41 2017 -0300

    scripts: Fix regression when using plurals on pybliocheck
    
    Fix encoding issue introduced in commit c01060d35.
    It takes advantage of unicode, but strings are weird in
    Python 2.
    
    This also fixes make distcheck

 scripts/pybliocheck.py |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/scripts/pybliocheck.py b/scripts/pybliocheck.py
index fcacc51..efa4095 100644
--- a/scripts/pybliocheck.py
+++ b/scripts/pybliocheck.py
@@ -1,24 +1,25 @@
 # -*- python -*-
+# -*- coding: utf-8 -*-
 # This file is part of pybliographer
-# 
+#
 # Copyright (C) 1998-2004 Frederic GOBRY
 # Email : gobry pybliographer org
-#         
+#
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2 
+# as published by the Free Software Foundation; either version 2
 # of the License, or (at your option) any later version.
-#   
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details. 
-# 
+# GNU General Public License for more details.
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-# 
-# 
+#
+#
 
 import os, sys, string
 from Pyblio import Config, Exceptions
@@ -61,9 +62,9 @@ for dir in sys.argv [2:]:
         # try to open the database
         try:
             b = bibopen (f)
-            print (_n("file “%s” is ok [%d entry]", 
-                      "file “%s” is ok [%d entries]", 
-                      len(b)) 
+            print (_n(u"file “%s” is ok [%d entry]",
+                      u"file “%s” is ok [%d entries]",
+                      len(b))
                    % (f, len (b))).encode (charset)
         except (Exceptions.ParserError, KeyError), err:
             broken.append (str (err))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]