summaryrefslogtreecommitdiffstats
path: root/module/threads/DecrypterThread.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/threads/DecrypterThread.py')
-rw-r--r--module/threads/DecrypterThread.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/module/threads/DecrypterThread.py b/module/threads/DecrypterThread.py
new file mode 100644
index 000000000..5ce59a65e
--- /dev/null
+++ b/module/threads/DecrypterThread.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from BaseThread import BaseThread
+
+class DecrypterThread(BaseThread):
+ """thread for decrypting"""
+
+ def __init__(self, manager, data, package):
+ """constructor"""
+ BaseThread.__init__(self, manager)
+ self.queue = data
+ self.package = package
+
+ self.m.log.debug("Starting Decrypt thread")
+
+ self.start()
+
+ def add(self, data):
+ self.queue.extend(data)
+
+ def run(self):
+ plugin_map = {}
+ for plugin, url in self.queue:
+ if plugin in plugin_map:
+ plugin_map[plugin].append(url)
+ else:
+ plugin_map[plugin] = [url]
+
+
+ self.decrypt(plugin_map)
+
+ def decrypt(self, plugin_map):
+ for name, urls in plugin_map.iteritems():
+ p = self.m.core.pluginManager.loadClass("crypter", name)