[Pkg-privacy-commits] [onioncircuits] 04/17: If a circuit is closed twice, dont readd it

Sascha Steinbiss sascha at steinbiss.name
Fri Feb 19 00:32:09 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 78a556605b367c8c1acc4c533d6703e4102c88c9
Author: Alan <alan at boum.org>
Date:   Thu Feb 18 19:48:29 2016 +0000

    If a circuit is closed twice, dont readd it
    
    With bad network conditions, stem sometimes sends the circuit closed event twice. When recieving the 2nd
    of these events, Tor Monitor used to add the circuit that had beeen removed from the list by the 1st.
    Will-fix: 10517
---
 MANIFEST.in         |  6 +++---
 README              |  6 +++---
 po/POTFILES.in      |  2 +-
 po/fr.po            | 18 +++++++++---------
 setup.py            | 10 +++++-----
 tor-monitor         | 23 +++++++++++++----------
 tor-monitor.desktop |  2 +-
 7 files changed, 35 insertions(+), 32 deletions(-)

diff --git a/MANIFEST.in b/MANIFEST.in
index 7728312..908238e 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,6 +1,6 @@
 include README
 include README.translators
-include tor-monitor
-include tor-monitor.desktop
-include tor-monitor.svg
+include onioncircuits
+include onioncircuits.desktop
+include onioncircuits.svg
 recursive-include po *.po POTFILES.in
diff --git a/README b/README
index a4fd929..024e79b 100644
--- a/README
+++ b/README
@@ -1,15 +1,15 @@
-Tor Monitor - a GTK application to display Tor circuits and streams
+Onion Circuits - a GTK application to display Tor circuits and streams
 Copyright (C) 2015  Tails developers
 
 Dependencies
 ============
 
-Tor Monitor depends on python3 (>= 3.4.2), python3-gi (>= 3.14.0), python3-stem
+Onion Circuits depends on python3 (>= 3.4.2), python3-gi (>= 3.14.0), python3-stem
 (>= 1.2.2), Gtk GIR (>= 3.14), GLib GIR (>= 1.42).
 
 It recommends pycountry (>= 1.8).
 
-Tor Monitor also build-depends on python3-distutils-extra.
+Onion Circuits also build-depends on python3-distutils-extra.
 
 On Debian system (>= 8.0), these can be installed with:
 
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 2395bcd..a33e83b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1 +1 @@
-tor-monitor
+onioncircuits
diff --git a/po/fr.po b/po/fr.po
index 16b2fdc..4559015 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -1,4 +1,4 @@
-# Tor Monitor - a GTK applicaton to display Tor circuits and streams
+# Onion Circuits - a GTK applicaton to display Tor circuits and streams
 # Copyright (C) 2015  Tails developers
 # This file is distributed under the same license as the Tor Manitor package.
 # Tails Developers <tails at boum.org>, 2015.
@@ -17,14 +17,14 @@ msgstr ""
 "X-Generator: Poedit 1.5.4\n"
 
 #: ../tormonitor:77
-msgid "Cannot connect to the Tor daemon. Tor Monitor will try to reconnect..."
+msgid "Cannot connect to the Tor daemon. Onion Circuits will try to reconnect..."
 msgstr ""
-"Impossible de se connecter au démon Tor. Tor Monitor va essayer de se "
+"Impossible de se connecter au démon Tor. Onion Circuits va essayer de se "
 "reconnecter..."
 
 #: ../tormonitor:90
-msgid "Tor Monitor"
-msgstr "Tor Monitor"
+msgid "Onion Circuits"
+msgstr "Onion Circuits"
 
 #: ../tormonitor:91
 msgid "Display Tor circuits and streams"
@@ -47,13 +47,13 @@ msgid "Click on a path to get details"
 msgstr "Cliquez sur un chemin pour obtenir des détails"
 
 #: ../tormonitor:209
-msgid "Lost connection to the Tor daemon. Tor Monitor will try to reconnect..."
+msgid "Lost connection to the Tor daemon. Onion Circuits will try to reconnect..."
 msgstr ""
-"Connexion au démon Tor perdue. Tor Monitor va essayer de se reconnecter..."
+"Connexion au démon Tor perdue. Onion Circuits va essayer de se reconnecter..."
 
 #: ../tormonitor:226
-msgid "Connected to the Tor daemon! You can use now Tor Monitor."
-msgstr "Connecté au démon Tor. Vous pouvez maintenant utiliser Tor Monitor."
+msgid "Connected to the Tor daemon! You can use now Onion Circuits."
+msgstr "Connecté au démon Tor. Vous pouvez maintenant utiliser Onion Circuits."
 
 #: ../tormonitor:308
 msgid "Building..."
diff --git a/setup.py b/setup.py
index a39e785..aeac164 100755
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 #
-# Tor Monitor - a GTK applicaton to display Tor circuits and streams
+# Onion Circuits - a GTK applicaton to display Tor circuits and streams
 # Copyright (C) 2015  Tails developers
 #
 # This program is free software: you can redistribute it and/or modify
@@ -19,15 +19,15 @@
 from distutils.core import setup, Command
 from DistUtilsExtra.command import *
 
-setup(name='tor-monitor',
+setup(name='onioncircuits',
       version='0.2',
       description='a GTK applicaton to display Tor circuits and streams',
       author='Tails developers',
       author_email='tails at boum.org',
       license='GNU GPL v3',
-      scripts=['tor-monitor'],
-      data_files=[('share/icons/hicolor/scalable/apps', ['tor-monitor.svg']),
-                  ('share/applications', ['tor-monitor.desktop'])],
+      scripts=['onioncircuits'],
+      data_files=[('share/icons/hicolor/scalable/apps', ['onioncircuits.svg']),
+                  ('share/applications', ['onioncircuits.desktop'])],
       requires=['stem', 'gi'],
       cmdclass = { "build" : build_extra.build_extra,
                    "build_i18n" :  build_i18n.build_i18n,
diff --git a/tor-monitor b/tor-monitor
index 9abb957..ae92fb9 100755
--- a/tor-monitor
+++ b/tor-monitor
@@ -1,6 +1,6 @@
 #!/usr/bin/env python3
 #
-# Tor Monitor - a GTK applicaton to display Tor circuits and streams
+# Onion Circuits - a GTK applicaton to display Tor circuits and streams
 # Copyright (C) 2015  Tails developers
 #
 # This program is free software: you can redistribute it and/or modify
@@ -44,7 +44,7 @@ else:
     logging.getLogger('stem').setLevel(logging.WARNING)
 
 class TorMonitorWindow(Gtk.ApplicationWindow):
-    """Tor Monitor main window
+    """Onion Circuits main window
 
     This class contains all the UI and the logic to update.
     """
@@ -75,7 +75,7 @@ class TorMonitorWindow(Gtk.ApplicationWindow):
             self._path.set_sensitive(False)
             self._treeview.set_sensitive(False)
             self._infobar_label.set_text(_("Cannot connect to the Tor daemon. "
-                                           "Tor Monitor will try to reconnect..."))
+                                           "Onion Circuits will try to reconnect..."))
             self._infobar.set_message_type(Gtk.MessageType.ERROR)
             self._infobar.show()
 
@@ -87,7 +87,7 @@ class TorMonitorWindow(Gtk.ApplicationWindow):
         self.connect('delete-event', self.delete_event_cb)
 
         headerbar = Gtk.HeaderBar()
-        headerbar.set_title(_("Tor Monitor"))
+        headerbar.set_title(_("Onion Circuits"))
         headerbar.set_subtitle(_("Display Tor circuits and streams"))
         headerbar.set_show_close_button(True)
         self.set_titlebar(headerbar)
@@ -209,7 +209,7 @@ class TorMonitorWindow(Gtk.ApplicationWindow):
         self._path.set_sensitive(False)
         self._treeview.set_sensitive(False)
         self._infobar_label.set_text(_("Lost connection to the Tor daemon. "
-                                       "Tor Monitor will try to reconnect..."))
+                                       "Onion Circuits will try to reconnect..."))
         self._infobar.set_message_type(Gtk.MessageType.ERROR)
         self._infobar.show()
         self._treestore.clear()
@@ -226,7 +226,7 @@ class TorMonitorWindow(Gtk.ApplicationWindow):
         self._path.set_sensitive(True)
         self._treeview.set_sensitive(True)
         self._infobar_label.set_text(_("Connected to the Tor daemon! "
-                                       "You can use now Tor Monitor."))
+                                       "You can use now Onion Circuits."))
         self._infobar.set_message_type(Gtk.MessageType.INFO)
         self._infobar.show()
         self.init_listeners()
@@ -367,12 +367,15 @@ class TorMonitorWindow(Gtk.ApplicationWindow):
 
         :var stem.response.events.CircuitEvent circ_event: the circuit event
         """
+        circ_is_closed = circ_event.status in [stem.CircStatus.FAILED,
+                                               stem.CircStatus.CLOSED]
+
         if circ_event.id not in self._circ_to_iter:
-            self.add_circuit(circ_event)
+            if not circ_is_closed:
+                self.add_circuit(circ_event)
         else:
             self.update_circuit(circ_event)
-            if (circ_event.status == stem.CircStatus.FAILED
-                    or circ_event.status == stem.CircStatus.CLOSED):
+            if circ_is_closed:
                 self.remove_circuit_delayed(circ_event)
 
     # Streams
@@ -571,7 +574,7 @@ class TorMonitorWindow(Gtk.ApplicationWindow):
         grid.show_all()
 
 class TorMonitorApplication(Gtk.Application):
-    """Tor Monitor application
+    """Onion Circuits application
 
     :var stem.control.Controller controller: a controller to the Tor daemon
     """
diff --git a/tor-monitor.desktop b/tor-monitor.desktop
index 316399f..b240292 100644
--- a/tor-monitor.desktop
+++ b/tor-monitor.desktop
@@ -1,5 +1,5 @@
 [Desktop Entry]
-Name=Tor Monitor
+Name=Onion Circuits
 Comment=Display Tor circuits and streams
 TryExec=tormonitor
 Exec=tormonitor

-- 
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