[Pkg-privacy-commits] [onioncircuits] 01/01: make behaviour when geoipdb is missing more verbose

Sascha Steinbiss sascha at steinbiss.name
Wed Mar 9 00:30:44 UTC 2016


This is an automated email from the git hooks/post-receive script.

sascha-guest pushed a commit to branch master
in repository onioncircuits.

commit df185de7a26b5e3ec61b0c438a976b1161d787e5
Author: Sascha Steinbiss <sascha at steinbiss.name>
Date:   Wed Mar 9 00:29:17 2016 +0000

    make behaviour when geoipdb is missing more verbose
---
 debian/patches/allow-failing-country-lookup.patch | 162 +++++++++++++++++++++-
 1 file changed, 159 insertions(+), 3 deletions(-)

diff --git a/debian/patches/allow-failing-country-lookup.patch b/debian/patches/allow-failing-country-lookup.patch
index a14e2f4..85c2af3 100644
--- a/debian/patches/allow-failing-country-lookup.patch
+++ b/debian/patches/allow-failing-country-lookup.patch
@@ -6,16 +6,172 @@ Forwarded: via email
 Last-Update: 2016-03-08 
 --- a/onioncircuits
 +++ b/onioncircuits
-@@ -541,7 +541,11 @@
+@@ -65,6 +65,7 @@
+         Gtk.Window.__init__(self, application=app)
+ 
+         self._listeners_initialized = False
++        self._geoip_msg_shown = False
+         self._circ_to_iter = {}
+         self._stream_to_iter = {}
+         self.controller = self.get_application().controller
+@@ -541,8 +542,18 @@
          :var stem.descriptor.router_status_entry.RouterStatusEntryMicroV3
          status_entry: the status entry for the node
          """
 -        country = self.controller.get_info("ip-to-country/%s" % status_entry.address)
+-        if pycountry:
 +        try:
 +            country = self.controller.get_info("ip-to-country/%s" % status_entry.address)
 +        except stem.ProtocolError:
-+            country = "?"
++            country = None
++            if not self._geoip_msg_shown:
++                self._infobar_label.set_text(_("GeoIP database unavailable. "
++                                               "No country information will be displayed."))
++                self._infobar.set_message_type(Gtk.MessageType.WARNING)
++                self._infobar.show()
++                self._geoip_msg_shown = True
 +
-         if pycountry:
++        if pycountry and country:
              try:
                  country = pycountry.countries.get(alpha2=country.upper()).name
+             except KeyError:
+@@ -560,10 +571,16 @@
+         title.set_halign(Gtk.Align.START)
+         grid.attach(title, 0, 0, 2, 1)
+ 
++        # if we couldn't get a country, just display the IP
++        if not country:
++            ipstr = str(status_entry.address)
++        else:
++            ipstr = _("%s (%s)") % (status_entry.address, country)
++
+         line = 1
+         for l, v in [(_("Fingerprint:"), status_entry.fingerprint),
+                      (_("Published:"), status_entry.published),
+-                     (_("IP:"), _("%s (%s)") % (status_entry.address, country)),
++                     (_("IP:"), ipstr),
+                      (_("Bandwidth:"), _("%.2f Mb/s") % (status_entry.bandwidth/1024.)),
+                     ]:
+             label = Gtk.Label(l)
+--- a/po/fr.po
++++ b/po/fr.po
+@@ -7,85 +7,93 @@
+ msgstr ""
+ "Project-Id-Version: \n"
+ "Report-Msgid-Bugs-To: \n"
+-"POT-Creation-Date: 2015-08-17 20:57+0000\n"
+-"PO-Revision-Date: 2015-08-17 21:05-0000\n"
++"POT-Creation-Date: 2016-03-09 00:24+0000\n"
++"PO-Revision-Date: 2016-03-09 00:24+0000\n"
+ "Last-Translator: Tails Developers <tails at boum.org>\n"
+ "Language-Team: Tails Developers <tails at boum.org>\n"
++"Language: fr\n"
+ "MIME-Version: 1.0\n"
+ "Content-Type: text/plain; charset=UTF-8\n"
+ "Content-Transfer-Encoding: 8bit\n"
+-"X-Generator: Poedit 1.5.4\n"
++"X-Generator: Poedit 1.8.7.1\n"
+ 
+-#: ../onioncircuits:77
+-msgid "Cannot connect to the Tor daemon. Onion Circuits will try to reconnect..."
++#: ../onioncircuits:82
++msgid ""
++"Cannot connect to the Tor daemon. Onion Circuits will try to reconnect..."
+ msgstr ""
+ "Impossible de se connecter au démon Tor. Onion Circuits va essayer de se "
+ "reconnecter..."
+ 
+-#: ../onioncircuits:90
++#: ../onioncircuits:95
+ msgid "Onion Circuits"
+ msgstr "Onion Circuits"
+ 
+-#: ../onioncircuits:91
++#: ../onioncircuits:96
+ msgid "Display Tor circuits and streams"
+ msgstr "Affiche les circuits et les flux de Tor"
+ 
+-#: ../onioncircuits:104
++#: ../onioncircuits:108
+ msgid "OK"
+ msgstr "OK"
+ 
+-#: ../onioncircuits:121
++#: ../onioncircuits:125
+ msgid "Path"
+ msgstr "Chemin"
+ 
+-#: ../onioncircuits:122
++#: ../onioncircuits:126
+ msgid "Status"
+ msgstr "Statut"
+ 
+-#: ../onioncircuits:135
++#: ../onioncircuits:142
+ msgid "Click on a path to get details"
+ msgstr "Cliquez sur un chemin pour obtenir des détails"
+ 
+-#: ../onioncircuits:209
+-msgid "Lost connection to the Tor daemon. Onion Circuits will try to reconnect..."
++#: ../onioncircuits:216
++msgid ""
++"Lost connection to the Tor daemon. Onion Circuits will try to reconnect..."
+ msgstr ""
+ "Connexion au démon Tor perdue. Onion Circuits va essayer de se reconnecter..."
+ 
+-#: ../onioncircuits:226
++#: ../onioncircuits:233
+ msgid "Connected to the Tor daemon! You can use now Onion Circuits."
+ msgstr "Connecté au démon Tor. Vous pouvez maintenant utiliser Onion Circuits."
+ 
+-#: ../onioncircuits:308
++#: ../onioncircuits:315
+ msgid "Building..."
+ msgstr "En construction..."
+ 
+-#: ../onioncircuits:333
++#: ../onioncircuits:340
+ #, c-format
+ msgid "%s: %s"
+ msgstr "%s : %s"
+ 
+-#: ../onioncircuits:552
++#: ../onioncircuits:550
++msgid "GeoIP database unavailable. No country information will be displayed."
++msgstr ""
++"Information GeoIP indisponible. Aucune information de pays sera affiché."
++
++#: ../onioncircuits:578
++#, c-format
++msgid "%s (%s)"
++msgstr "%s (%s)"
++
++#: ../onioncircuits:581
+ msgid "Fingerprint:"
+ msgstr "Empreinte :"
+ 
+-#: ../onioncircuits:553
++#: ../onioncircuits:582
+ msgid "Published:"
+ msgstr "Publié :"
+ 
+-#: ../onioncircuits:554
++#: ../onioncircuits:583
+ msgid "IP:"
+ msgstr "IP :"
+ 
+-#: ../onioncircuits:554
+-#, c-format
+-msgid "%s (%s)"
+-msgstr "%s (%s)"
+-
+-#: ../onioncircuits:555
++#: ../onioncircuits:584
+ msgid "Bandwidth:"
+ msgstr "Bande passante :"
+ 
+-#: ../onioncircuits:555
++#: ../onioncircuits:584
+ #, c-format
+ msgid "%.2f Mb/s"
+ msgstr "%2f Mo/s"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onioncircuits.git



More information about the Pkg-privacy-commits mailing list