Use proper sorting

This commit is contained in:
Ruud
2014-03-08 11:52:59 +01:00
parent b50cf1cf4c
commit dc0ea5b3f6
3 changed files with 10 additions and 19 deletions
+5 -2
View File
@@ -11,7 +11,7 @@
# Source: http://pypi.python.org/pypi/axel
# Docs: http://packages.python.org/axel
from couchpotato.core.helpers.variable import natcmp
from couchpotato.core.helpers.variable import natsortKey
import Queue
import hashlib
import sys
@@ -158,7 +158,10 @@ class Event(object):
t.daemon = True
t.start()
for handler in sorted(self.handlers.iterkeys(), cmp = natcmp):
handler_keys = self.handlers.keys()
handler_keys.sort(key = natsortKey)
for handler in handler_keys:
self.queue.put(handler)
if self.asynchronous: