From 72abfb455275546e110e4daf811480dd47ffceea Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 12 Aug 2010 22:44:41 +0200 Subject: improvements --- module/plugins/Plugin.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'module/plugins/Plugin.py') diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index 04a5adb91..02a15dfbc 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -34,6 +34,14 @@ from os import makedirs from tempfile import NamedTemporaryFile from mimetypes import guess_type +from itertools import islice + +def chunks(iterable, size): + it = iter(iterable) + item = list(islice(it, size)) + while item: + yield item + item = list(islice(it, size)) def dec(func): def new(*args): -- cgit v1.2.3