[Pkg-privacy-commits] [tor-monitor] 08/39: Order the methods more cleanly
Sascha Steinbiss
sascha-guest at moszumanska.debian.org
Tue Aug 25 18:00:43 UTC 2015
This is an automated email from the git hooks/post-receive script.
sascha-guest pushed a commit to branch master
in repository tor-monitor.
commit 3d7792dc477cf8f7cc0e5c095ef6aeb914979492
Author: Tails developers <tails at boum.org>
Date: Tue Feb 17 03:29:34 2015 +0100
Order the methods more cleanly
---
tormonitor | 34 +++++++++++++++++++++++-----------
1 file changed, 23 insertions(+), 11 deletions(-)
diff --git a/tormonitor b/tormonitor
index 999f2d7..67b5f79 100755
--- a/tormonitor
+++ b/tormonitor
@@ -131,6 +131,16 @@ class TorMonitorWindow(Gtk.ApplicationWindow):
self.show_all()
+ def delete_event_cb(self, widget, event, data=None):
+ logging.info("quitting, waiting all threads to return...")
+ self.hide()
+ while Gtk.events_pending():
+ Gtk.main_iteration()
+ return False
+
+ # TOR CONTROL LISTENERS
+ # =====================
+
def init_listeners(self):
# Connect our handlers to Tor event listeners. Our handlers won't be
# executed in the main thread.
@@ -157,6 +167,9 @@ class TorMonitorWindow(Gtk.ApplicationWindow):
elif state == stem.control.State.INIT:
GLib.idle_add(self.connection_init_cb)
+ # RECONNECTION MANAGEMENT
+ # =======================
+
def connection_closed_cb(self):
logging.debug("Controller connection closed")
self._hbox.set_sensitive(False)
@@ -198,16 +211,12 @@ class TorMonitorWindow(Gtk.ApplicationWindow):
else:
return True
- def delete_event_cb(self, widget, event, data=None):
- logging.info("quitting, waiting all threads to return...")
- self.hide()
- while Gtk.events_pending():
- Gtk.main_iteration()
- return False
-
# CRICUITS AND STREAMS LIST
# =========================
+ # Circuits
+ # --------
+
@staticmethod
def circuit_label(circuit):
if circuit.path:
@@ -216,10 +225,6 @@ class TorMonitorWindow(Gtk.ApplicationWindow):
circ_str = _("Building...")
return circ_str
- @staticmethod
- def stream_label(stream):
- return "%s" % stream.target
-
def add_circuit(self, circuit):
circ_iter = self._treestore.append(None,
[self.TYPE_CIRC,
@@ -255,6 +260,13 @@ class TorMonitorWindow(Gtk.ApplicationWindow):
or circ_event.status == stem.CircStatus.CLOSED):
GLib.timeout_add_seconds(5, self.remove_circuit, circ_event)
+ # Streams
+ # -------
+
+ @staticmethod
+ def stream_label(stream):
+ return "%s" % stream.target
+
def add_stream(self, stream):
if not stream.circ_id:
return None
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/tor-monitor.git
More information about the Pkg-privacy-commits
mailing list