[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [arm/master] Use explicit counting to remove dependency on scoping rules.
commit f213ff7a9ecefe197faa91b980aa8a67819bdf4b
Author: Kamran Riaz Khan <krkhan@xxxxxxxxxxxxxx>
Date: Sat Jul 9 16:55:24 2011 +0500
Use explicit counting to remove dependency on scoping rules.
---
src/gui/connections/connPanel.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/gui/connections/connPanel.py b/src/gui/connections/connPanel.py
index ad57878..9df5142 100644
--- a/src/gui/connections/connPanel.py
+++ b/src/gui/connections/connPanel.py
@@ -44,9 +44,11 @@ class ConnectionPanel(CliConnectionPanel):
treestore = self.builder.get_object('treestore_conn')
# first pass checks whether we have enough entries cached to not update the treeview
- for (index, line) in enumerate(self._entryLines):
+ index = 0
+ for line in self._entryLines:
local = "%s:%s" % (line.local.ipAddr, line.local.port)
foreign = "%s:%s" % (line.foreign.ipAddr, line.foreign.port)
+
cachekey = (local, foreign)
if self.cache.has_key(cachekey):
timeLabel = "%d s" % (time.time() - line.startTime)
@@ -54,7 +56,9 @@ class ConnectionPanel(CliConnectionPanel):
else:
break
- if index == len(self._entryLines) - 1:
+ index = index + 1
+
+ if index == len(self._entryLines):
return
treestore.clear()
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits