Module: deluge
Branch: 1.3-stable
Commit: 03689a805b7d5a1ca9bf2e3652db2af63751bdd2

Author: Calum Lind <[email protected]>
Date:   Fri Feb 11 01:05:28 2011 +0000

Fix #1510 - Cannot create a torrent with only non-zero tier trackers

---

 deluge/ui/gtkui/createtorrentdialog.py |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/deluge/ui/gtkui/createtorrentdialog.py 
b/deluge/ui/gtkui/createtorrentdialog.py
index c455eb0..3535d9f 100644
--- a/deluge/ui/gtkui/createtorrentdialog.py
+++ b/deluge/ui/gtkui/createtorrentdialog.py
@@ -283,14 +283,11 @@ class CreateTorrentDialog:
             tracker = None
         else:
             # Create a list of lists [[tier0, ...], [tier1, ...], ...]
+            tier_dict = {}
             for tier, tracker in self.trackers_liststore:
-                try:
-                    tier_list = trackers[tier]
-                except IndexError:
-                    trackers.insert(tier, [])
-
-                trackers[tier].append(tracker)
+                tier_dict.setdefault(tier, []).append(tracker)
 
+            trackers = [tier_dict[tier] for tier in sorted(tier_dict)]
             # Get the first tracker in the first tier
             tracker = trackers[0][0]
 

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to