From b4aa60892fb60efd57f593006f35f94868a646da Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 5 Feb 2010 22:08:48 +0100 Subject: FlashGot + ClickNLoad Support + Webif. improvm.!! pyLoad FTW !! --- pyLoadCore.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'pyLoadCore.py') diff --git a/pyLoadCore.py b/pyLoadCore.py index f85191ec4..30f025bbc 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -108,7 +108,7 @@ class Core(object): self.do_kill = False self.do_restart = False translation = gettext.translation("pyLoad", join(self.path, "locale"), languages=[self.config['general']['language']]) - translation.install(unicode=False if sys.getdefaultencoding() == "ascii" else True) + translation.install(unicode=(False if sys.stdout.encoding == "ascii" else True)) self.check_install("Crypto", _("pycrypto to decode container files")) self.check_install("Image", _("Python Image Libary (PIL) for captha reading")) @@ -449,12 +449,15 @@ class ServerMethods(): self.core.file_list.collector.addLink(link) self.core.file_list.save() - def add_package(self, name, links): + def add_package(self, name, links, queue=True): pid = self.new_package(name) - self.core.file_list.packager.pushPackage2Queue(pid) + fids = map(self.core.file_list.collector.addLink, links) map(lambda fid: self.move_file_2_package(fid, pid), fids) - self.push_package_2_queue(pid) + + if queue: + self.core.file_list.packager.pushPackage2Queue(pid) + self.core.file_list.save() def new_package(self, name): -- cgit v1.2.3