From: Michael Tremer Date: Wed, 25 Nov 2020 23:54:40 +0000 (+0000) Subject: web: Drop grouper function X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=279d31d99a3e7d535a6566fd9b351d8c10a361ca;p=ipfire.org.git web: Drop grouper function Signed-off-by: Michael Tremer --- diff --git a/src/web/__init__.py b/src/web/__init__.py index fd5f8016..651d4de7 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -1,7 +1,6 @@ #/usr/bin/python import logging -import itertools import os.path import phonenumbers import phonenumbers.geocoder @@ -56,7 +55,6 @@ class Application(tornado.web.Application): "format_phone_number" : self.format_phone_number, "format_phone_number_to_e164" : self.format_phone_number_to_e164, "format_phone_number_location" : self.format_phone_number_location, - "grouper" : grouper, }, # UI Modules @@ -420,17 +418,3 @@ class Application(tornado.web.Application): ] return ", ".join((e for e in s if e)) - - -def grouper(handler, iterator, n): - """ - Returns groups of n from the iterator - """ - i = iter(iterator) - - while True: - ret = list(itertools.islice(i, 0, n)) - if not ret: - break - - yield ret