[Apt-listbugs-commits] [SCM] apt-listbugs development tree branch, master, updated. apt-listbugs/0.1.9-24-gee1a321

Francesco Poli (wintermute) invernomuto at paranoici.org
Sat Jul 27 19:52:10 UTC 2013


The following commit has been merged in the master branch:
commit 166acfc610ce93d274602890032fb7ca58cea7a6
Author: Francesco Poli (wintermute) <invernomuto at paranoici.org>
Date:   Wed Jul 24 22:16:56 2013 +0200

    use UTF-8 arrows, whenever the charset is UTF-8

diff --git a/debian/changelog b/debian/changelog
index 397e012..6fa3d9a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,7 @@ apt-listbugs (0.1.10) UNRELEASED; urgency=low
     /usr/share/common-licenses/GPL-2
   * fixed a typo in the comment included in the initial version of
     /etc/apt/listbugs/ignore_bugs
+  * adopted UTF-8 arrows, when charset is UTF-8
 
  -- Francesco Poli (wintermute) <invernomuto at paranoici.org>  Sat, 29 Jun 2013 17:18:26 +0200
 
diff --git a/lib/apt-listbugs/logic.rb b/lib/apt-listbugs/logic.rb
index bab78f2..b7e4ab5 100644
--- a/lib/apt-listbugs/logic.rb
+++ b/lib/apt-listbugs/logic.rb
@@ -96,12 +96,18 @@ class AppConfig
 
     @yes = nil
 
+    @arrow = "->"
+    @xarrow = "->"
+    if Locale.charset == "UTF-8"
+      @arrow = "→"
+      @xarrow = "→"
+    end
   end
 
   attr_accessor :severity, :stats, :quiet, :title
   attr_accessor :show_downgrade, :hostname, :tag, :fbugs
   attr_accessor :frontend, :pin_priority, :yes, :ignore_regexp
-  attr_reader :command, :parser, :querybts, :ignore_bugs, :system_ignore_bugs, :browser
+  attr_reader :command, :parser, :querybts, :ignore_bugs, :system_ignore_bugs, :browser, :arrow, :xarrow
 
   def parse_options
     opt_parser = GetoptLong.new
@@ -557,7 +563,7 @@ class Viewer
                 buf = _("%{sevty} bugs of %{packg} (") % {:sevty => severity,
                                                           :packg => pkg}
                 buf += "#{cur_pkgs[pkg]['version']} " if cur_pkgs[pkg] != nil
-                buf += "-> #{new_pkgs[pkg]['version']}) <#{@config.statmap(bug.stat)}>"
+                buf += "#{@config.arrow} #{new_pkgs[pkg]['version']}) <#{@config.statmap(bug.stat)}>"
                 @config.frontend.puts buf
                 bug_exist = 1
               end
@@ -644,7 +650,7 @@ class Viewer
           tmp.puts "        <td class=\"pkg\">#{pkg}</td>"
           tmp.print "\n        <td>"
           tmp.print "#{cur_pkgs[pkg]['version']} " if cur_pkgs[pkg] != nil
-          tmp.print "-> #{new_pkgs[pkg]['version']}" if new_pkgs[pkg] != nil
+          tmp.print "#{@config.xarrow} #{new_pkgs[pkg]['version']}" if new_pkgs[pkg] != nil
           tmp.puts "</td>\n\n        <td>#{bug.severity}</td>"
           tmp.puts "\n        <td><a href=\"http://bugs.debian.org/#{bug.bug_number}\">##{bug.bug_number}</a></td>"
           tmp.puts "\n        <td class=\"desc\">#{bug.desc}</td>\n      </tr>"

-- 
apt-listbugs development tree



More information about the Apt-listbugs-commits mailing list